mirror of
https://github.com/torvalds/linux
synced 2024-09-19 18:46:35 +00:00
btrfs: sysfs: relax bg_reclaim_threshold for debugging purposes
Currently, /sys/fs/btrfs/<UUID>/bg_reclaim_threshold is limited to 0 (disable) or [50 .. 100]%, so we need to fill 50% of a device to start the auto reclaim process. It is cumbersome to do so when we want to shake out possible race issues of normal write vs reclaim. Relax the threshold check under the BTRFS_DEBUG option. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
2cef0c79bb
commit
d1cc579383
|
@ -1262,8 +1262,13 @@ static ssize_t btrfs_bg_reclaim_threshold_store(struct kobject *kobj,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
#ifdef CONFIG_BTRFS_DEBUG
|
||||
if (thresh != 0 && (thresh > 100))
|
||||
return -EINVAL;
|
||||
#else
|
||||
if (thresh != 0 && (thresh <= 50 || thresh > 100))
|
||||
return -EINVAL;
|
||||
#endif
|
||||
|
||||
WRITE_ONCE(fs_info->bg_reclaim_threshold, thresh);
|
||||
|
||||
|
|
Loading…
Reference in a new issue