Skip to content

Commit 1fa7603

Browse files
committed
btrfs: qgroup: update rescan message levels and error codes
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: [email protected] # 6.6+ Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0e39c9e commit 1fa7603

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
@@ -3820,14 +3820,14 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
38203820
/* we're resuming qgroup rescan at mount time */
38213821
if (!(fs_info->qgroup_flags &
38223822
BTRFS_QGROUP_STATUS_FLAG_RESCAN)) {
3823-
btrfs_warn(fs_info,
3823+
btrfs_debug(fs_info,
38243824
"qgroup rescan init failed, qgroup rescan is not queued");
38253825
ret = -EINVAL;
38263826
} else if (!(fs_info->qgroup_flags &
38273827
BTRFS_QGROUP_STATUS_FLAG_ON)) {
3828-
btrfs_warn(fs_info,
3828+
btrfs_debug(fs_info,
38293829
"qgroup rescan init failed, qgroup is not enabled");
3830-
ret = -EINVAL;
3830+
ret = -ENOTCONN;
38313831
}
38323832

38333833
if (ret)
@@ -3838,14 +3838,12 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
38383838

38393839
if (init_flags) {
38403840
if (fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN) {
3841-
btrfs_warn(fs_info,
3842-
"qgroup rescan is already in progress");
38433841
ret = -EINPROGRESS;
38443842
} else if (!(fs_info->qgroup_flags &
38453843
BTRFS_QGROUP_STATUS_FLAG_ON)) {
3846-
btrfs_warn(fs_info,
3844+
btrfs_debug(fs_info,
38473845
"qgroup rescan init failed, qgroup is not enabled");
3848-
ret = -EINVAL;
3846+
ret = -ENOTCONN;
38493847
} else if (btrfs_qgroup_mode(fs_info) == BTRFS_QGROUP_MODE_DISABLED) {
38503848
/* Quota disable is in progress */
38513849
ret = -EBUSY;

0 commit comments

Comments
 (0)