Skip to content

Commit

Permalink
[PATCH] knfsd: improve the test for cross-device-rename in nfsd
Browse files Browse the repository at this point in the history
Just testing the i_sb isn't really enough, at least the vfsmnt must be the
same.  Thanks Al.

Cc: Al Viro <viro@ftp.linux.org.uk>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jun 30, 2006
1 parent 8c2a6a4 commit a56f393
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
tdir = tdentry->d_inode;

err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
if (fdir->i_sb != tdir->i_sb)
if (ffhp->fh_export != tfhp->fh_export)
goto out;

err = nfserr_perm;
Expand Down

0 comments on commit a56f393

Please sign in to comment.