]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Fix bch2_fs_get_tree() error path
authorFlorian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Thu, 27 Mar 2025 13:31:08 +0000 (14:31 +0100)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 28 Mar 2025 17:51:09 +0000 (13:51 -0400)
commit7c4cb50e1a39ada75aaaaaedfdaec52d0b8f8bcc
treea7589dbc7fd18da3ca78546d308e79c1edf6948c
parent6b1e0b9e182e4f2117a1c72947d4ab26f43533d8
bcachefs: Fix bch2_fs_get_tree() error path

When a filesystem is mounted read-only, subsequent attempts to mount it
as read-write fail with EBUSY. Previously, the error path in
bch2_fs_get_tree() would unconditionally call __bch2_fs_stop(),
improperly freeing resources for a filesystem that was still actively
mounted. This change modifies the error path to only call
__bch2_fs_stop() if the superblock has no valid root dentry, ensuring
resources are not cleaned up prematurely when the filesystem is in use.

Signed-off-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c