Linux NFS development
 help / color / mirror / Atom feed
* [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
* [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
* [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

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-12  5:48 [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST Ni Wenjuan
2009-03-18  1:55 ` Ni Wenjuan
2009-03-18 23:10   ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2009-03-19  0:37 Ni Wenjuan
2009-03-19 19:47 ` J. Bruce Fields
2009-03-20  3:58   ` Ni Wenjuan
2009-03-10  8:20 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox