From: Namjae Jeon <linkinjeon@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Namjae Jeon <namjae.jeon@samsung.com>,
Ravishankar N <ravi.n1@samsung.com>,
Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH v5 5/8] fat: restructure export_operations
Date: Thu, 6 Dec 2012 18:43:32 +0900 [thread overview]
Message-ID: <CAKYAXd-_wRwZQUAOfGfKkUoCagmYRnnrUanyF-rzRAJ0oXVDbA@mail.gmail.com> (raw)
In-Reply-To: <87mwxrttwf.fsf@devron.myhome.or.jp>
2012/12/6, OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>:
> Namjae Jeon <linkinjeon@gmail.com> writes:
>
>>> I know encode_fh(). But NFS is network protocol, and network can input
>>> any data, and I guess the userland interface (open_by_handle()?) can be
>>> any too.
>>>
>>> And generic_fh_to_dentry()'s input verify choose to check the minimum
>>> length only. But your logic choose the exact length.
>>>
>>> I think the both is sane and correct. But I wonder why did you changed
>>> it.
>> There was no particular reason for us to put those conditions. It is
>> just we knew what fh lengths we have chosen for the 2 cases
>> WITH/WITHOUT parent.
>> i.e., we checked with encoded length.
>> Now, when I check the export functions of other filesystems(btrfs,
>> nilfs2, udf). They also adopt the same method of checking the exact
>> length and type.
>> If there is any particular reason, we will look into that and can also
>> updated on that.
>
> OK. Then, just cleanup code, and let's use strict checking version.
>
> Removing strange fallthrou, something like the following.
>
> 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;
> break;
> case FILEID_FAT_WITH_PARENT:
> if (fh_len < FAT_FID_SIZE_WITH_PARENT)
> return NULL;
> break;
> default:
> return NULL;
> }
>
> i_pos = fid->i_pos_hi;
> i_pos = (i_pos << 32) | (fid->i_pos_low);
> inode = __fat_nfs_get_inode(sb, 0, fid->i_gen, i_pos);
>
> return d_obtain_alias(inode);
> }
Okay. I will change like this on next patch-set.
Thanks OGAWA!
>
>
> --
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>
prev parent reply other threads:[~2012-12-06 9:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 13:24 [PATCH v5 5/8] fat: restructure export_operations Namjae Jeon
2012-12-03 9:51 ` OGAWA Hirofumi
2012-12-04 6:23 ` Namjae Jeon
2012-12-04 9:28 ` OGAWA Hirofumi
2012-12-05 5:58 ` Namjae Jeon
2012-12-05 8:56 ` OGAWA Hirofumi
2012-12-05 11:45 ` Namjae Jeon
2012-12-05 12:11 ` OGAWA Hirofumi
2012-12-06 7:37 ` Namjae Jeon
2012-12-06 9:24 ` OGAWA Hirofumi
2012-12-06 9:43 ` Namjae Jeon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKYAXd-_wRwZQUAOfGfKkUoCagmYRnnrUanyF-rzRAJ0oXVDbA@mail.gmail.com \
--to=linkinjeon@gmail.com \
--cc=a.sahrawat@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--cc=ravi.n1@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).