]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: qgroup: set quota enabled bit if quota disable fails flushing reservations
authorFilipe Manana <fdmanana@suse.com>
Tue, 1 Jul 2025 10:39:44 +0000 (11:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:36:30 +0000 (18:36 +0200)
commitb213dd06a8eb32a63334abc66dad9e5c58d4967f
tree69b025ba03ac621779ba456b43252b709c1efa84
parenta2be668c49437e784335ea3dacea7fb8f4b279f1
btrfs: qgroup: set quota enabled bit if quota disable fails flushing reservations

commit e41c75ca3189341e76e6af64b857c05b68a1d7db upstream.

Before waiting for the rescan worker to finish and flushing reservations,
we clear the BTRFS_FS_QUOTA_ENABLED flag from fs_info. If we fail flushing
reservations we leave with the flag not set which is not correct since
quotas are still enabled - we must set back the flag on error paths, such
as when we fail to start a transaction, except for error paths that abort
a transaction. The reservation flushing happens very early before we do
any operation that actually disables quotas and before we start a
transaction, so set back BTRFS_FS_QUOTA_ENABLED if it fails.

Fixes: af0e2aab3b70 ("btrfs: qgroup: flush reservations during quota disable")
CC: stable@vger.kernel.org # 6.12+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/qgroup.c