Subject: Re: linux-next: manual merge of the vfs tree with the vfs-brauner tree

From: Al Viro <[email-masked]>
Date: Tue, 8 Jul 2025 01:25:09 +0100

On Tue, Jul 08, 2025 at 09:38:37AM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the vfs tree got a conflict in:
> 
>   fs/fhandle.c
> 
> between commit:
> 
>   1c5484395f9f ("fhandle: reflow get_path_anchor()")
> 
> from the vfs-brauner tree and commit:
> 
>   8ae91ad6499b ("fold fs_struct->{lock,seq} into a seqlock")
> 
> from the vfs tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Umm...  Let's do it that way - fs/fhandle.c chunk of that commit is
trivially split off and the rest should not conflict at all.

Christian, would you mind throwing this on top of your vfs.pidfs?  I'm dropping
that part from my #work.misc commit...

[PATCH] get_path_from_fd(): don't open-code get_fs_pwd()
    
Signed-off-by: Al Viro <[email-masked]>
---
diff --git a/fs/fhandle.c b/fs/fhandle.c
index b1363ead6c5e..7c236f64cdea 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -180,11 +180,7 @@ static int get_path_anchor(int fd, struct path *root)
 	}
 
 	if (fd == AT_FDCWD) {
-		struct fs_struct *fs = current->fs;
-		spin_lock(&fs->lock);
-		*root = fs->pwd;
-		path_get(root);
-		spin_unlock(&fs->lock);
+		get_fs_pwd(current->fs, root);
 		return 0;
 	}