All of lore.kernel.org
 help / color / mirror / Atom feed
* Can ovl_drop_write() be called earlier in ovl_dentry_open()
@ 2015-06-01 13:52 David Howells
  2015-06-01 14:21 ` [PATCH] overlay: Call ovl_drop_write() " David Howells
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Howells @ 2015-06-01 13:52 UTC (permalink / raw)
  To: Miklos Szeredi, viro; +Cc: linux-kernel, linux-fsdevel, linux-unionfs, dhowells

In ovl_dentry_open(), ovl_drop_write() is called after vfs_open() - but is
this actually necessary?  Can't we just drop it post-copyup?  After all,
that's all we wanted the write lock for, right?

David
---
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -356,16 +356,14 @@ static int ovl_dentry_open(struct dentry *dentry, struct inode *inode,
 			err = ovl_copy_up_last(dentry, NULL, true);
 		else
 			err = ovl_copy_up(dentry);
+		ovl_drop_write(dentry);
 		if (err)
-			goto out_drop_write;
+			goto out;
 
 		ovl_path_upper(dentry, &realpath);
 	}
 
 	err = vfs_open(&realpath, d_backing_inode(realpath.dentry), file, cred);
-out_drop_write:
-	if (want_write)
-		ovl_drop_write(dentry);
 out:
 	return err;
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-01 15:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 13:52 Can ovl_drop_write() be called earlier in ovl_dentry_open() David Howells
2015-06-01 14:21 ` [PATCH] overlay: Call ovl_drop_write() " David Howells
2015-06-01 14:22 ` Can ovl_drop_write() be called " Miklos Szeredi
2015-06-01 15:45 ` David Howells
2015-06-01 15:51   ` Miklos Szeredi
2015-06-01 15:53   ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.