From: Ni Wenjuan <niwj@cn.fujitsu.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Yang Hongyang <yanghy@cn.fujitsu.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
Date: Fri, 03 Apr 2009 13:24:08 +0800 [thread overview]
Message-ID: <49D59D78.2000701@cn.fujitsu.com> (raw)
In-Reply-To: <20090311234613.GA21273@fieldses.org>
> J. Bruce Fields =E5=86=99=E9=81=93:
>> On Thu, Mar 19, 2009 at 08:37:05AM +0800, Ni Wenjuan wrote:
>>> Fix a test in rename operation. rename dir1 into existing,nonempty =
dir2 should
>>> return NFS4ERR_EXIST instead got NFS4ERR_NOTEMPTY. RFC says if the=
target is a
>>> directory but not empty, the server will return the error, NFS4ERR_=
EXIST.
>>
>> On a second look: could you double-check the client behavior?:
>> Currently
>>
>> mkdir subdir
>> mkdir -p todir/subdir
>> touch todir/subdir/foo
>> mv subdir todir/
>>
>> results (as in the local case) in "Directory not empty". What happe=
ns
>> after applying this patch?
>>
>> --b.
>=20
> before patch, if you execute "mv subdir todir/" ,client (as in the =
local case) will notices you that cannot move 'subdir' to a subdirector=
y of itself ,'todir/subdie'.
>=20
> after applying patch, if you execute "mv subdir todir/" ,it will not=
ices you that can't move 'subdir to todir/subdir' :File exists .
>=20
>=20
Bruce , is there any other problems about this patch?
>>
>>> Signed-off-by:Ni Wenjuan <niwj@cn.fujitsu.com>
>>>
>>> ---
>>> fs/nfsd/nfs4proc.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
>>> index 9fa60a3..c1e2e22 100644
>>> --- a/fs/nfsd/nfs4proc.c
>>> +++ b/fs/nfsd/nfs4proc.c
>>> @@ -605,7 +605,7 @@ nfsd4_rename(struct svc_rqst *rqstp, struct
>>> nfsd4_compound_state *cstate,
>>>
>>> /* the underlying filesystem returns different error's than re=
quired
>>> * by NFSv4. both save_fh and current_fh have been verified.. =
*/
>>> - if (status =3D=3D nfserr_isdir)
>>> + if (status =3D=3D nfserr_isdir || status =3D=3D nfserr_notempt=
y)
>>> status =3D nfserr_exist;
>>> else if ((status =3D=3D nfserr_notdir) &&
>>> (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_m=
ode) &&
>>> --=20
>>>
>>
>>
next prev parent reply other threads:[~2009-04-03 5:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 8:20 [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST Ni Wenjuan
2009-03-10 8:22 ` Yang Hongyang
2009-03-11 23:46 ` J. Bruce Fields
2009-04-03 5:24 ` Ni Wenjuan [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-03-12 5:48 Ni Wenjuan
2009-03-18 1:55 ` Ni Wenjuan
2009-03-18 23:10 ` J. Bruce Fields
2009-03-19 0:37 Ni Wenjuan
2009-03-19 19:47 ` J. Bruce Fields
2009-03-20 3:58 ` Ni Wenjuan
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=49D59D78.2000701@cn.fujitsu.com \
--to=niwj@cn.fujitsu.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=yanghy@cn.fujitsu.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