Skip to content

Commit 4ce2aff

Browse files
ksawaraykdave
authored andcommitted
btrfs: add back warning for mount option commit values exceeding 300
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: 6941823 ("btrfs: remove old mount API code") CC: [email protected] # 6.12+ Reviewed-by: Qu Wenruo <[email protected]> Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Kyoji Ogasawara <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a0fd1c6 commit 4ce2aff

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

fs/btrfs/fs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ enum {
300300
#define BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR 0ULL
301301

302302
#define BTRFS_DEFAULT_COMMIT_INTERVAL (30)
303+
#define BTRFS_WARNING_COMMIT_INTERVAL (300)
303304
#define BTRFS_DEFAULT_MAX_INLINE (2048)
304305

305306
struct btrfs_dev_replace {

fs/btrfs/super.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,10 @@ static int btrfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
569569
break;
570570
case Opt_commit_interval:
571571
ctx->commit_interval = result.uint_32;
572+
if (ctx->commit_interval > BTRFS_WARNING_COMMIT_INTERVAL) {
573+
btrfs_warn(NULL, "excessive commit interval %u, use with care",
574+
ctx->commit_interval);
575+
}
572576
if (ctx->commit_interval == 0)
573577
ctx->commit_interval = BTRFS_DEFAULT_COMMIT_INTERVAL;
574578
break;

0 commit comments

Comments
 (0)