lkml.org 
[lkml]   [2006]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [RFC][PATCH 11/20] elevate write count over calls to vfs_rename()
From
Date
On Sun, 2006-06-18 at 19:23 +0100, Al Viro wrote:
> a) nfsd_rename() should check that tfhp->fh_export->ex_mnt ==
> ffhp->fh_export->ex_mnt (if not that tfhp->fh_export == ffhp->fh_export)
> instead of comparing ->i_sb
> b) that patch should do mnt_want_write() only once.

Here's a replacement.

diff -puN fs/nfsd/vfs.c~C-elevate-writers-vfs_rename-part1 fs/nfsd/vfs.c
--- lxc/fs/nfsd/vfs.c~C-elevate-writers-vfs_rename-part1 2006-06-19 08:43:10.000000000 -0700
+++ lxc-dave/fs/nfsd/vfs.c 2006-06-19 10:09:19.000000000 -0700
@@ -1597,13 +1597,21 @@ nfsd_rename(struct svc_rqst *rqstp, stru
err = -EPERM;
} else
#endif
+ err = -EXDEV
+ if (ffhp->fh_export->ex_mnt != tfhp->fh_export->ex_mnt)
+ goto out_dput_new;
+
+ err = mnt_want_write(ffhp->fh_export->ex_mnt);
+ if (err)
+ goto out_dput_new;
+
err = vfs_rename(fdir, odentry, tdir, ndentry);
if (!err && EX_ISSYNC(tfhp->fh_export)) {
err = nfsd_sync_dir(tdentry);
if (!err)
err = nfsd_sync_dir(fdentry);
}
-
+ mnt_drop_write(ffhp->fh_export->ex_mnt);
out_dput_new:
dput(ndentry);
out_dput_old:


-- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-19 19:21    [W:0.177 / U:1.044 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site