From: NeilBrown Date: Fri, 30 Jun 2006 08:56:10 +0000 (-0700) Subject: [PATCH] knfsd: improve the test for cross-device-rename in nfsd X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a56f39375a7bd183149c18286389e4a58ac9bc95;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] knfsd: improve the test for cross-device-rename in nfsd Just testing the i_sb isn't really enough, at least the vfsmnt must be the same. Thanks Al. Cc: Al Viro Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 245eaa1fb59b..b653ede37e66 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -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;