mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 16:47:42 +00:00
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>
This commit is contained in:
parent
b3981564ca
commit
707549600c
@ -541,10 +541,12 @@ static long bch2_ioctl_subvolume_destroy(struct bch_fs *c, struct file *filp,
|
|||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
ret = __bch2_unlink(dir, victim, true);
|
|
||||||
|
ret = inode_permission(file_mnt_idmap(filp), d_inode(victim), MAY_WRITE) ?:
|
||||||
|
__bch2_unlink(dir, victim, true);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
fsnotify_rmdir(dir, victim);
|
fsnotify_rmdir(dir, victim);
|
||||||
d_delete(victim);
|
d_invalidate(victim);
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
inode_unlock(dir);
|
inode_unlock(dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user