2009-03-10 08:21:20

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




2009-03-10 08:23:55

by Yang Hongyang

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

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 [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>


--
Regards
Yang Hongyang