Commit 98fb679d19a1 for kernel

commit 98fb679d19a17aec624d53b016953a3fcd272e8d
Merge: 4080cf02f11e 650f5353dcc9
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Mon Mar 31 18:33:51 2025 -0700

    Merge tag 'bcachefs-2025-03-31' of git://evilpiepirate.org/bcachefs

    Pull more bcachefs updates from Kent Overstreet:
     "All bugfixes and logging improvements"

    * tag 'bcachefs-2025-03-31' of git://evilpiepirate.org/bcachefs: (35 commits)
      bcachefs: fix bch2_write_point_to_text() units
      bcachefs: Log original key being moved in data updates
      bcachefs: BCH_JSET_ENTRY_log_bkey
      bcachefs: Reorder error messages that include journal debug
      bcachefs: Don't use designated initializers for disk_accounting_pos
      bcachefs: Silence errors after emergency shutdown
      bcachefs: fix units in rebalance_status
      bcachefs: bch2_ioctl_subvolume_destroy() fixes
      bcachefs: Clear fs_path_parent on subvolume unlink
      bcachefs: Change btree_insert_node() assertion to error
      bcachefs: Better printing of inconsistency errors
      bcachefs: bch2_count_fsck_err()
      bcachefs: Better helpers for inconsistency errors
      bcachefs: Consistent indentation of multiline fsck errors
      bcachefs: Add an "ignore unknown" option to bch2_parse_mount_opts()
      bcachefs: bch2_time_stats_init_no_pcpu()
      bcachefs: Fix bch2_fs_get_tree() error path
      bcachefs: fix logging in journal_entry_err_msg()
      bcachefs: add missing newline in bch2_trans_updates_to_text()
      bcachefs: print_string_as_lines: fix extra newline
      ...

diff --cc fs/bcachefs/fs-ioctl.c
index f45054cee746,0273130f18dc..c1553e44e049
--- 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);