From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Namjae Jeon <linkinjeon@gmail.com>
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: Wed, 05 Dec 2012 17:56:55 +0900 [thread overview]
Message-ID: <871uf4yizs.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <CAKYAXd-8ay4m6vsH1ztmomOrnXN+ThDi3w+jASyyUGOO12v6YA@mail.gmail.com> (Namjae Jeon's message of "Wed, 5 Dec 2012 14:58:39 +0900")
Namjae Jeon <linkinjeon@gmail.com> writes:
>>> 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?
> With fileID type="FILEID_FAT_WITHOUT_PARENT", fhlen should be '3'
> With fileId type="FILEID_FAT_WITH_PARENT", fhlen should be '5'
>
> While encoding, WITH_PARENT is selected when subtree check is enabled
> on the NFS Server.
>
> So, when decoding request is arrived- fileid type will be among the '2' cases:
> Now, in case of fh_to_dentry() - when we consider, that the reqquest
> for fileid type WITH_PARENT
> then i think the conditions in fh_to_dentry should be:
>
> if((fh_type == FILEID_FAT_WITH_PARENT) && fh_len != 5)
> return NULL;
> else if (fh_len != 3)
> return NULL;
>
> So, we took care of these '2' conditions within the switch statement
> based on the 'fh_type'. We can just change the comparision condition
> from '<' to '!=':
> 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;
> + 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);
> + break;
> + }
>
> I think there is no need to push the comparision statements in the
> begining similar to generic_fh_to_dentry.
I can understand what is doing. I'm asking why there is difference.
1) generic_fh_to_dentry() allows (*_PARENT && fh_len == 2).
2) fat_fh_to_dentry_nostale() doesn't allows (*_PARENT && fh_len == 3).
Why does logic has difference?
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2012-12-05 8:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 13:24 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 [this message]
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
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=871uf4yizs.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=a.sahrawat@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=linkinjeon@gmail.com \
--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
all inboxes | Powered by JetHome®