[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a430d18-39ac-135f-d522-90d44276faf8@gmail.com>
Date: Wed, 16 Sep 2020 18:30:25 +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()
>> --- a/fs/exfat/namei.c
>> +++ b/fs/exfat/namei.c
>> @@ -1095,11 +1095,6 @@ static int exfat_move_file(struct inode *inode,
>> struct exfat_chain *p_olddir,
>> if (!epmov)
>> return -EIO;
>>
>> - /* check if the source and target directory is the same */
>> - if (exfat_get_entry_type(epmov) == TYPE_DIR &&
>> - le32_to_cpu(epmov->dentry.stream.start_clu) == p_newdir->dir)
>> - return -EINVAL;
>> -
>
> 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.
BTW
Are you busy now?
I am waiting for your reply about "integrates dir-entry getting and validation" patch.
BR
---
Tetsuhiro Kohada <kohada.t2@...il.com>
Powered by blists - more mailing lists