Skip to content

Commit e43a8a6

Browse files
kdaveroxanan1996
authored andcommitted
btrfs: qgroup: update rescan message levels and error codes
BugLink: https://bugs.launchpad.net/bugs/2073788 commit 1fa7603d569b9e738e9581937ba8725cd7d39b48 upstream. On filesystems without enabled quotas there's still a warning message in the logs when rescan is called. In that case it's not a problem that should be reported, rescan can be called unconditionally. Change the error code to ENOTCONN which is used for 'quotas not enabled' elsewhere. Remove message (also a warning) when rescan is called during an ongoing rescan, this brings no useful information and the error code is sufficient. Change message levels to debug for now, they can be removed eventually. CC: stable@vger.kernel.org # 6.6+ Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent 311ffb5 commit e43a8a6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

fs/btrfs/qgroup.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,14 +3763,14 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
37633763
/* we're resuming qgroup rescan at mount time */
37643764
if (!(fs_info->qgroup_flags &
37653765
BTRFS_QGROUP_STATUS_FLAG_RESCAN)) {
3766-
btrfs_warn(fs_info,
3766+
btrfs_debug(fs_info,
37673767
"qgroup rescan init failed, qgroup rescan is not queued");
37683768
ret = -EINVAL;
37693769
} else if (!(fs_info->qgroup_flags &
37703770
BTRFS_QGROUP_STATUS_FLAG_ON)) {
3771-
btrfs_warn(fs_info,
3771+
btrfs_debug(fs_info,
37723772
"qgroup rescan init failed, qgroup is not enabled");
3773-
ret = -EINVAL;
3773+
ret = -ENOTCONN;
37743774
}
37753775

37763776
if (ret)
@@ -3781,14 +3781,12 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
37813781

37823782
if (init_flags) {
37833783
if (fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN) {
3784-
btrfs_warn(fs_info,
3785-
"qgroup rescan is already in progress");
37863784
ret = -EINPROGRESS;
37873785
} else if (!(fs_info->qgroup_flags &
37883786
BTRFS_QGROUP_STATUS_FLAG_ON)) {
3789-
btrfs_warn(fs_info,
3787+
btrfs_debug(fs_info,
37903788
"qgroup rescan init failed, qgroup is not enabled");
3791-
ret = -EINVAL;
3789+
ret = -ENOTCONN;
37923790
} else if (btrfs_qgroup_mode(fs_info) == BTRFS_QGROUP_MODE_DISABLED) {
37933791
/* Quota disable is in progress */
37943792
ret = -EBUSY;

0 commit comments

Comments
 (0)