Re: [PATCH v1 2/6] exfat: add exfat_get_dentry_set_by_inode() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> @@ -999,7 +992,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
>>         if (num_new_entries < 0)
>>                 return num_new_entries;
>>
>> -       ret = exfat_get_dentry_set(&old_es, sb, p_dir, oldentry, ES_ALL_ENTRIES);
>> +       ret = exfat_get_dentry_set_by_inode(&old_es, &ei->vfs_inode);
> It is better to just use exfat_get_dentry_set rather than
> exfat_get_dentry_set_by_inode here.
>
>>         if (ret) {
>>                 ret = -EIO;
>>                 return ret;
>> @@ -1053,21 +1046,18 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
>>         return ret;
>>  }
>>
>> -static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
>> -               int oldentry, struct exfat_chain *p_newdir,
>> +static int exfat_move_file(struct inode *inode, struct exfat_chain *p_newdir,
>>                 struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
>>  {
>>         int ret, newentry, num_new_entries;
>>         struct exfat_dentry *epmov, *epnew;
>> -       struct super_block *sb = inode->i_sb;
>>         struct exfat_entry_set_cache mov_es, new_es;
>>
>>         num_new_entries = exfat_calc_num_entries(p_uniname);
>>         if (num_new_entries < 0)
>>                 return num_new_entries;
>>
>> -       ret = exfat_get_dentry_set(&mov_es, sb, p_olddir, oldentry,
>> -                       ES_ALL_ENTRIES);
>> +       ret = exfat_get_dentry_set_by_inode(&mov_es, &ei->vfs_inode);
> It's the same here. It is better to just use If using exfat_get_dentry_set() like this().
> Thanks.

Thanks for your comment.
These two changes are necessary, do you mean to move these 2 changes to patch [6/6]?

Before applying patch [6/6], if using exfat_get_dentry_set() like this, it can correctly
get dentry set.

struct exfat_inode_info *parent_ei = EXFAT_I(parent_dir);
struct exfat_inode_info *child_ei =  EXFAT_I(child_inode);
exfat_chain_set(&cdir, parent_ei->start_clu, EXFAT_B_TO_CLU(i_size_read(parent_dir), sbi), parent_ei->flags);
exfat_get_dentry_set(&es, sb, &cdir, child_ei->entry, ES_ALL_ENTRIES);

After applying patch [6/6], child_ei->entry may not start from EXFAT_I(parent_dir)->start_clu,
but from child_ei->dir.dir. If using exfat_get_dentry_set() like this, it may not correctly get
dentry set.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux