

---

 fs/nfsd/vfs.c       |    0 
 lxc-dave/fs/namei.c |   11 +++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff -puN fs/namei.c~elevate-writers-vfs_create fs/namei.c
--- lxc/fs/namei.c~elevate-writers-vfs_create	2006-06-01 15:55:58.000000000 -0700
+++ lxc-dave/fs/namei.c	2006-06-01 15:55:58.000000000 -0700
@@ -1461,22 +1461,29 @@ void unlock_rename(struct dentry *p1, st
 int vfs_create(struct inode *dir, struct dentry *dentry, int mode,
 		struct nameidata *nd)
 {
-	int error = may_create(dir, dentry, nd);
+	int error;
 
+	error = mnt_want_write(nd.mnt);
 	if (error)
 		return error;
 
+	error = may_create(dir, dentry, nd);
+	if (error)
+		goto out;
+
 	if (!dir->i_op || !dir->i_op->create)
 		return -EACCES;	/* shouldn't it be ENOSYS? */
 	mode &= S_IALLUGO;
 	mode |= S_IFREG;
 	error = security_inode_create(dir, dentry, mode);
 	if (error)
-		return error;
+		goto out;
 	DQUOT_INIT(dir);
 	error = dir->i_op->create(dir, dentry, mode, nd);
 	if (!error)
 		fsnotify_create(dir, dentry);
+out:
+	mnt_put_write(nd.mnt);
 	return error;
 }
 
diff -puN fs/nfsd/vfs.c~elevate-writers-vfs_create fs/nfsd/vfs.c
_
