Subject: linux-next: manual merge of the bcachefs tree with Linus' tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 31 Mar 2025 09:28:16 +1100

Hi all,

Today's linux-next merge of the bcachefs tree got a conflict in:

  fs/bcachefs/fs-ioctl.c

between commit:

  1c3cb50b58c3 ("VFS: change kern_path_locked() and user_path_locked_at() to never return negative dentry")

from Linus' tree and commit:

  707549600c4a ("bcachefs: bch2_ioctl_subvolume_destroy() fixes")

from the bcachefs 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/bcachefs/fs-ioctl.c
index f45054cee746,0273130f18dc..000000000000
--- a/fs/bcachefs/fs-ioctl.c
+++ b/fs/bcachefs/fs-ioctl.c
@@@ -537,10 -537,16 +537,12 @@@ static long bch2_ioctl_subvolume_destro
  		ret = -EXDEV;
  		goto err;
  	}
- 	ret = __bch2_unlink(dir, victim, true);
 -	if (!d_is_positive(victim)) {
 -		ret = -ENOENT;
 -		goto err;
 -	}
+ 
+ 	ret =   inode_permission(file_mnt_idmap(filp), d_inode(victim), MAY_WRITE) ?:
+ 		__bch2_unlink(dir, victim, true);
  	if (!ret) {
  		fsnotify_rmdir(dir, victim);
- 		d_delete(victim);
+ 		d_invalidate(victim);
  	}
  err:
  	inode_unlock(dir);