lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Sep 2020 13:01:47 +0900
From:   Tetsuhiro Kohada <kohada.t2@...il.com>
To:     Sungjong Seo <sj1557.seo@...sung.com>
Cc:     kohada.tetsuhiro@...mitsubishielectric.co.jp,
        mori.takahiro@...mitsubishielectric.co.jp,
        motai.hirotaka@...mitsubishielectric.co.jp,
        'Namjae Jeon' <namjae.jeon@...sung.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] exfat: remove useless check in exfat_move_file()

>>> It might check if the cluster numbers are same between source entry
>>> and target directory.
>>
>> This checks if newdir is the move target itself.
>> Example:
>>     mv /mnt/dir0 /mnt/dir0/foo
>>
>> However, this check is not enough.
>> We need to check newdir and all ancestors.
>> Example:
>>     mv /mnt/dir0 /mnt/dir0/dir1/foo
>>     mv /mnt/dir0 /mnt/dir0/dir1/dir2/foo
>>     ...
>>
>> This is probably a taboo for all layered filesystems.
>>
>>
>>> Could you let me know what code you mentioned?
>>> Or do you mean the codes on vfs?
>>
>> You can find in do_renameat2(). --- around 'fs/namei.c:4440'
>> If the destination ancestors are itself, our driver will not be called.
> 
> I think, of course, vfs has been doing that.
> So that code is unnecessary in normal situations.
> 
> That code comes from the old exfat implementation.

It could be a remnant of another system.
Once upon a time, I moved the dir to a descendant dir without implementing this check
and it disappeared forever.
linux-VFS fixed this issue immediately, but some systems still need to be checked by
the driver itself. (ex.Windows-IFS)


> And as far as I understand, it seems to check once more "the cluster number"
> even though it comes through vfs so that it tries detecting abnormal of on-disk.
> 
> Anyway, I agonized if it is really needed.
> In conclusion, old code could be eliminated and your patch looks reasonable.

It's easy to add, but it's really hard to remove the ancient code.


BTW
I have a question for you.
Now, I'm trying to optimize exfat_get_dentry().
However, exfat_get_dentry() is used a lot, so the patch is also large.
In such a case
-Replace old implementation with new ones with a single patch.
-Devide multiple patches in which old functions and new functions (ex. exfat_get_dentry2) coexist temporarily. And finally clean up.

I understand that a small patch is desirable, but the latter has "two similar functions".
Which is better for you to review the patch?


BR
---
Tetsuhiro Kohada <kohada.t2@...il.com>
  

Powered by blists - more mailing lists