Re: [PATCH v5 5/8] fat: restructure export_operations

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

 



Namjae Jeon <linkinjeon@xxxxxxxxx> writes:

>>> +static struct dentry *fat_fh_to_dentry_nostale(struct super_block *sb,
>>> +					       struct fid *fh, int fh_len,
>>> +					       int fh_type)
>>> +{
>>> +	struct inode *inode = NULL;
>>> +	struct fat_fid *fid = (struct fat_fid *)fh;
>>> +	loff_t i_pos;
>>> +
>>> +	switch (fh_type) {
>>> +	case FILEID_FAT_WITHOUT_PARENT:
>>> +		if (fh_len < FAT_FID_SIZE_WITHOUT_PARENT)
>>> +			return NULL;
>>> +	case FILEID_FAT_WITH_PARENT:
>>> +		if ((fh_len < FAT_FID_SIZE_WITH_PARENT) &&
>>> +			(fh_type == FILEID_FAT_WITH_PARENT))
>>> +			return NULL;
>>
>> Do we have to care (FILEID_FAT_WITH_PARENT and fh_len < 5) here?
>>
>> 	if (fh_len < 2)
>> 		return NULL;
>>
>> 	switch (fh_type) {
>> 	case FILEID_INO32_GEN:
>> 	case FILEID_INO32_GEN_PARENT:
>> 		inode = get_inode(sb, fid->i32.ino, fid->i32.gen);
>> 		break;
>> 	}
>>
>> 	return d_obtain_alias(inode);
>>
>> generic_fh_to_dentry() is above. I wonder why we have to care
>> fat_fid->parent* here.
> Let me think, if ‘subtree’ checking is enabled then we should check
> the length condition over here also? Please share if there are any
> other comments also.

I'm not sure what did you mean. Where is "subtree" check you are
talking? This is fh_to_dentry(), so we don't use parent at all, so
length == 3 is enough?
-- 
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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