btrfs: add back warning for mount option commit values exceeding 300
commit 4ce2affc6ef9f84b4aebbf18bd5c57397b6024eb upstream.
The Btrfs documentation states that if the commit value is greater than
300 a warning should be issued. The warning was accidentally lost in the
new mount API update.
Fixes: 6941823cc8 ("btrfs: remove old mount API code")
CC: stable@vger.kernel.org # 6.12+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Kyoji Ogasawara <sawara04.o@gmail.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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bf804f34ad
commit
3ee6399854
@@ -285,6 +285,7 @@ enum {
|
||||
#define BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR 0ULL
|
||||
|
||||
#define BTRFS_DEFAULT_COMMIT_INTERVAL (30)
|
||||
#define BTRFS_WARNING_COMMIT_INTERVAL (300)
|
||||
#define BTRFS_DEFAULT_MAX_INLINE (2048)
|
||||
|
||||
struct btrfs_dev_replace {
|
||||
|
||||
@@ -570,6 +570,10 @@ static int btrfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
|
||||
break;
|
||||
case Opt_commit_interval:
|
||||
ctx->commit_interval = result.uint_32;
|
||||
if (ctx->commit_interval > BTRFS_WARNING_COMMIT_INTERVAL) {
|
||||
btrfs_warn(NULL, "excessive commit interval %u, use with care",
|
||||
ctx->commit_interval);
|
||||
}
|
||||
if (ctx->commit_interval == 0)
|
||||
ctx->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user