Skip to content

Commit 7075496

Browse files
author
Kent Overstreet
committed
bcachefs: bch2_ioctl_subvolume_destroy() fixes
bch2_evict_subvolume_inodes() was getting stuck - due to incorrectly pruning the dcache. Also, fix missing permissions checks. Reported-by: Alexander Viro <viro@zeniv.linux.org.uk> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent b398156 commit 7075496

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/bcachefs/fs-ioctl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,12 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp,
541541
ret = -ENOENT;
542542
goto err;
543543
}
544-
ret = __bch2_unlink(dir, victim, true);
544+
545+
ret = inode_permission(file_mnt_idmap(filp), d_inode(victim), MAY_WRITE) ?:
546+
__bch2_unlink(dir, victim, true);
545547
if (!ret) {
546548
fsnotify_rmdir(dir, victim);
547-
d_delete(victim);
549+
d_invalidate(victim);
548550
}
549551
err:
550552
inode_unlock(dir);

0 commit comments

Comments
 (0)