Thread (47 messages) 47 messages, 7 authors, 2024-03-22

Re: [PATCH RFC 06/24] vfs: break parent dir delegations in open(..., O_CREAT) codepath

From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2024-03-17 00:20:11
Also in: linux-cifs, linux-fsdevel, linux-nfs, linux-unionfs, lkml, netfs

On Fri, Mar 15, 2024 at 12:52:57PM -0400, Jeff Layton wrote:
In order to add directory delegation support, we need to break
delegations on the parent whenever there is going to be a change in the
directory.

Add a delegated_inode parameter to lookup_open and have it break the
delegation. Then, open_last_lookups can wait for the delegation break
and retry the call to lookup_open once it's done.
quoted hunk ↗ jump to hunk
@@ -3490,6 +3490,11 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file,
Wait a sec - are you going to do anything to the atomic_open side of things?
 
 	/* Negative dentry, just create the file */
 	if (!dentry->d_inode && (open_flag & O_CREAT)) {
+		/* but break the directory lease first! */
+		error = try_break_deleg(dir_inode, delegated_inode);
+		if (error)
+			goto out_dput;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help