2009-03-12 05:49:04

by Ni Wenjuan

[permalink] [raw]
Subject: [PATCH] Replace NFS4ERR_NOTEMPY with NFS4ERR_EXIST

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 <[email protected]>

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