]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bcachefs: unlock parent dir if entry is not found in subvolume deletion
authorGuoyu Ou <benogy@gmail.com>
Sun, 28 Jan 2024 08:46:17 +0000 (16:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2024 18:14:31 +0000 (19:14 +0100)
commita18ae02db4d5a4129739bbe44396b0e946192d0a
tree0de8fb7e52d8116f5881fc7503cb874f6060a40a
parent4571eb9bead1116305cb4910b224836770dce4bb
bcachefs: unlock parent dir if entry is not found in subvolume deletion

commit 6bb3f7f4c3f4da8e09de188f2f63e8f741bba3bd upstream.

Parent dir is locked by user_path_locked_at() before validating the
required dentry. It should be unlocked if we can not perform the
deletion.

This fixes the problem:

$ bcachefs subvolume delete not-exist-entry
BCH_IOCTL_SUBVOLUME_DESTROY ioctl error: No such file or directory
$ bcachefs subvolume delete not-exist-entry

the second will stuck because the parent dir is locked in the previous
deletion.

Signed-off-by: Guoyu Ou <benogy@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/bcachefs/fs-ioctl.c