All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
@ 2009-03-10  8:20 Ni Wenjuan
  2009-03-10  8:22 ` Yang Hongyang
  0 siblings, 1 reply; 10+ messages in thread
From: Ni Wenjuan @ 2009-03-10  8:20 UTC (permalink / raw)
  To: linux-nfs


Fix a test in rename operation. rename dir1 into existing,nonempty dir2 should
return  NFS4ERR_EXIST instead got NFS4ERR_NOTEMPY. RFC says if the target is a
directory but not empty, the server will return the error, NFS4ERR_EXIST.

------
fs/nfsd/nfs4proc.c | 2 +-
1 files changed, 1 insertion(+) ,1 deletion (-)

diff -Nurp fs/nfsd/nfs4proc_orig.c fs/nfsd/nfs4proc.c
--- fs/nfsd/nfs4proc_orig.c	2009-02-23 20:28:56.000000000 +0800
+++ fs/nfsd/nfs4proc.c	2009-03-05 16:56:56.000000000 +0800

@@ -585,10 +586,11 @@ nfsd4_rename(struct svc_rqst *rqstp, str
   	status = nfsd_rename(rqstp, save_fh, rename->rn_sname,
  			     rename->rn_snamelen, current_fh,
  			     rename->rn_tname, rename->rn_tnamelen);

  	/* the underlying filesystem returns different error's than required
  	 * by NFSv4. both save_fh and current_fh have been verified.. */
    -	if (status == nfserr_isdir)
    +	if (status == nfserr_isdir || status == nfserr_notempty)
  		status = nfserr_exist;
  	else if ((status == nfserr_notdir) &&
                    (S_ISDIR(save_fh->fh_dentry->d_inode->i_mode) &&



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Yang Hongyang @ 2009-03-10  8:22 UTC (permalink / raw)
  To: Ni Wenjuan; +Cc: linux-nfs

Ni Wenjuan wrote:
> Fix a test in rename operation. rename dir1 into existing,nonempty dir2 should
> return  NFS4ERR_EXIST instead got NFS4ERR_NOTEMPY. RFC says if the target is a
> directory but not empty, the server will return the error, NFS4ERR_EXIST.
> 

SOF && please use git to generate patch.

> ------
> fs/nfsd/nfs4proc.c | 2 +-
> 1 files changed, 1 insertion(+) ,1 deletion (-)
> 
> diff -Nurp fs/nfsd/nfs4proc_orig.c fs/nfsd/nfs4proc.c
> --- fs/nfsd/nfs4proc_orig.c	2009-02-23 20:28:56.000000000 +0800
> +++ fs/nfsd/nfs4proc.c	2009-03-05 16:56:56.000000000 +0800
> 
> @@ -585,10 +586,11 @@ nfsd4_rename(struct svc_rqst *rqstp, str
>    	status = nfsd_rename(rqstp, save_fh, rename->rn_sname,
>   			     rename->rn_snamelen, current_fh,
>   			     rename->rn_tname, rename->rn_tnamelen);
> 
>   	/* the underlying filesystem returns different error's than required
>   	 * by NFSv4. both save_fh and current_fh have been verified.. */
>     -	if (status == nfserr_isdir)
>     +	if (status == nfserr_isdir || status == nfserr_notempty)
>   		status = nfserr_exist;
>   	else if ((status == nfserr_notdir) &&
>                     (S_ISDIR(save_fh->fh_dentry->d_inode->i_mode) &&
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


-- 
Regards
Yang Hongyang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-10  8:22 ` Yang Hongyang
@ 2009-03-11 23:46   ` J. Bruce Fields
  2009-04-03  5:24     ` Ni Wenjuan
  0 siblings, 1 reply; 10+ messages in thread
From: J. Bruce Fields @ 2009-03-11 23:46 UTC (permalink / raw)
  To: Yang Hongyang; +Cc: Ni Wenjuan, linux-nfs

On Tue, Mar 10, 2009 at 04:22:47PM +0800, Yang Hongyang wrote:
> Ni Wenjuan wrote:
> > Fix a test in rename operation. rename dir1 into existing,nonempty dir2 should
> > return  NFS4ERR_EXIST instead got NFS4ERR_NOTEMPY. RFC says if the target is a
> > directory but not empty, the server will return the error, NFS4ERR_EXIST.
> > 
> 
> SOF && please use git to generate patch.

Also, when you resend--could send any server patches to me (in addition
to the linux-nfs list)?  

The content of the patch looks ok, thanks.

--b.

> 
> > ------
> > fs/nfsd/nfs4proc.c | 2 +-
> > 1 files changed, 1 insertion(+) ,1 deletion (-)
> > 
> > diff -Nurp fs/nfsd/nfs4proc_orig.c fs/nfsd/nfs4proc.c
> > --- fs/nfsd/nfs4proc_orig.c	2009-02-23 20:28:56.000000000 +0800
> > +++ fs/nfsd/nfs4proc.c	2009-03-05 16:56:56.000000000 +0800
> > 
> > @@ -585,10 +586,11 @@ nfsd4_rename(struct svc_rqst *rqstp, str
> >    	status = nfsd_rename(rqstp, save_fh, rename->rn_sname,
> >   			     rename->rn_snamelen, current_fh,
> >   			     rename->rn_tname, rename->rn_tnamelen);
> > 
> >   	/* the underlying filesystem returns different error's than required
> >   	 * by NFSv4. both save_fh and current_fh have been verified.. */
> >     -	if (status == nfserr_isdir)
> >     +	if (status == nfserr_isdir || status == nfserr_notempty)
> >   		status = nfserr_exist;
> >   	else if ((status == nfserr_notdir) &&
> >                     (S_ISDIR(save_fh->fh_dentry->d_inode->i_mode) &&
> > 
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> > 
> 
> 
> -- 
> Regards
> Yang Hongyang
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-11 23:46   ` J. Bruce Fields
@ 2009-04-03  5:24     ` Ni Wenjuan
  0 siblings, 0 replies; 10+ messages in thread
From: Ni Wenjuan @ 2009-04-03  5:24 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Yang Hongyang, linux-nfs

> 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
>>>
>>
>>





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-19 19:47 ` J. Bruce Fields
@ 2009-03-20  3:58   ` Ni Wenjuan
  0 siblings, 0 replies; 10+ messages in thread
From: Ni Wenjuan @ 2009-03-20  3:58 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs

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 d=
ir2 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_E=
XIST.
>=20
> On a second look: could you double-check the client behavior?:
> Currently
>=20
> 	mkdir subdir
> 	mkdir -p todir/subdir
> 	touch todir/subdir/foo
> 	mv subdir todir/
>=20
> results (as in the local case) in "Directory not empty".  What happen=
s
> after applying this patch?
>=20
> --b.

before patch,  if you execute "mv subdir todir/"  ,client (as in the lo=
cal case)=20
will notices you that cannot move 'subdir' to a subdirectory of itself=20
,'todir/subdie'.

after applying patch, if you execute "mv subdir todir/"  ,it will notic=
es you=20
that can't move 'subdir to todir/subdir' :File exists .


>=20
>> 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 requir=
ed
>>  	 * 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_notempty)
>>  		status =3D nfserr_exist;
>>  	else if ((status =3D=3D nfserr_notdir) &&
>>                    (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mo=
de) &&
>> --=20
>>
>=20
>=20



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-19  0:37 Ni Wenjuan
@ 2009-03-19 19:47 ` J. Bruce Fields
  2009-03-20  3:58   ` Ni Wenjuan
  0 siblings, 1 reply; 10+ messages in thread
From: J. Bruce Fields @ 2009-03-19 19:47 UTC (permalink / raw)
  To: Ni Wenjuan; +Cc: linux-nfs

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 happens
after applying this patch?

--b.

>
> 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 required
>  	 * by NFSv4. both save_fh and current_fh have been verified.. */
> -	if (status == nfserr_isdir)
> +	if (status == nfserr_isdir || status == nfserr_notempty)
>  		status = nfserr_exist;
>  	else if ((status == nfserr_notdir) &&
>                    (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mode) &&
> -- 
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
@ 2009-03-19  0:37 Ni Wenjuan
  2009-03-19 19:47 ` J. Bruce Fields
  0 siblings, 1 reply; 10+ messages in thread
From: Ni Wenjuan @ 2009-03-19  0:37 UTC (permalink / raw)
  To: linux-nfs, bfields

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.

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 required
  	 * by NFSv4. both save_fh and current_fh have been verified.. */
-	if (status == nfserr_isdir)
+	if (status == nfserr_isdir || status == nfserr_notempty)
  		status = nfserr_exist;
  	else if ((status == nfserr_notdir) &&
                    (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mode) &&
-- 


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-18  1:55 ` Ni Wenjuan
@ 2009-03-18 23:10   ` J. Bruce Fields
  0 siblings, 0 replies; 10+ messages in thread
From: J. Bruce Fields @ 2009-03-18 23:10 UTC (permalink / raw)
  To: Ni Wenjuan; +Cc: linux-nfs

On Wed, Mar 18, 2009 at 09:55:47AM +0800, Ni Wenjuan wrote:
> Ni Wenjuan =E5=86=99=E9=81=93:
> > 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.
> >=20
> > Signed-off-by:Ni Wenjuan  <niwj@cn.fujitsu.com>
> >=20
> > ---
> >  fs/nfsd/nfs4proc.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >=20
> > 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,
> >=20
> >  	/* the underlying filesystem returns different error's than requi=
red
> >  	 * 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_notempty)
> >  		status =3D nfserr_exist;
> >  	else if ((status =3D=3D nfserr_notdir) &&
> >                    (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_m=
ode) &&
>=20
> Bruce ,do you think this patch is ok ?   Can it be accepted?

OK.  Did you already post this patch?  Sorry, I can't seem to find it.
Could you repost in the standard format?

--b.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
  2009-03-12  5:48 Ni Wenjuan
@ 2009-03-18  1:55 ` Ni Wenjuan
  2009-03-18 23:10   ` J. Bruce Fields
  0 siblings, 1 reply; 10+ messages in thread
From: Ni Wenjuan @ 2009-03-18  1:55 UTC (permalink / raw)
  To: linux-nfs, bfields

Ni Wenjuan =D0=B4=B5=C0:
> Fix a test in rename operation. rename dir1 into existing,nonempty di=
r2 should
> return  NFS4ERR_EXIST instead got NFS4ERR_NOTEMPTY. RFC says if the t=
arget is a
> directory but not empty, the server will return the error, NFS4ERR_EX=
IST.
>=20
> Signed-off-by:Ni Wenjuan  <niwj@cn.fujitsu.com>
>=20
> ---
>  fs/nfsd/nfs4proc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>=20
> 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,
>=20
>  	/* the underlying filesystem returns different error's than require=
d
>  	 * 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_notempty)
>  		status =3D nfserr_exist;
>  	else if ((status =3D=3D nfserr_notdir) &&
>                    (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mod=
e) &&

Bruce ,do you think this patch is ok ?   Can it be accepted?


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST
@ 2009-03-12  5:48 Ni Wenjuan
  2009-03-18  1:55 ` Ni Wenjuan
  0 siblings, 1 reply; 10+ messages in thread
From: Ni Wenjuan @ 2009-03-12  5:48 UTC (permalink / raw)
  To: linux-nfs, bfields

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.

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 required
 	 * by NFSv4. both save_fh and current_fh have been verified.. */
-	if (status == nfserr_isdir)
+	if (status == nfserr_isdir || status == nfserr_notempty)
 		status = nfserr_exist;
 	else if ((status == nfserr_notdir) &&
                   (S_ISDIR(cstate->save_fh.fh_dentry->d_inode->i_mode) &&
-- 



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-04-03  5:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.