]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix mount failure when qgroup rescan is in progress
authorFilipe Manana <fdmanana@suse.com>
Tue, 26 Jun 2018 23:43:15 +0000 (00:43 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 28 Jun 2018 09:30:57 +0000 (11:30 +0200)
commit5c3c559139df068f521988795c9c575c4cc3458e
tree8e7697a52d859cf09e5195ebbd8d59d7ef657071
parentf24f0cee328ae66599e889328193ce4e68d03553
Btrfs: fix mount failure when qgroup rescan is in progress

If a power failure happens while the qgroup rescan kthread is running,
the next mount operation will always fail. This is because of a recent
regression that makes qgroup_rescan_init() incorrectly return -EINVAL
when we are mounting the filesystem (through btrfs_read_qgroup_config()).
This causes the -EINVAL error to be returned regardless of any qgroup
flags being set instead of returning the error only when neither of
the flags BTRFS_QGROUP_STATUS_FLAG_RESCAN nor BTRFS_QGROUP_STATUS_FLAG_ON
are set.

A test case for fstests follows up soon.

Fixes: f99f2e18a7f5 ("btrfs: qgroup: show more meaningful qgroup_rescan_init error message")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c