btrfs: Implement warning for commit values exceeding 300
PATCH v2 1/1 btrfs: Implement warning for commit values exceeding 300
From: Kyoji Ogasawara <[email protected]>
The Btrfs documentation states that if the commit value is greater than 300 a warning should be issued. This commit implements that functionality. For more details, visit:
https://btrfs.readthedocs.io/en/latest/Administration.html#btrfs-specific-mount-options
--- fs/btrfs/fs.h | 1 + fs/btrfs/super.c | 4 ++++ 2 files changed, 5 insertions(+)
fs/btrfs/fs.h +1 -0
@@ -300,6 +300,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 {
fs/btrfs/super.c +4 -0
@@ -569,6 +569,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 ;
Signature · 1 line
2.49.0
Quoted 9 lines · 在 2025/5/9 19:56, [email protected] 写道:
From: Kyoji Ogasawara <[email protected]>
The Btrfs documentation states that if the commit value is greater than 300 a warning should be issued. This commit implements that functionality. For more details, visit:
https://btrfs.readthedocs.io/en/latest/Administration.html#btrfs-specific-mount-optionsFixes 6941823cc878 ("btrfs: remove old mount API code")Signed-off-by Kyoji Ogasawara <[email protected]>
Thanks,
Qu
Quoted 32 lines
--- fs/btrfs/fs.h | 1 + fs/btrfs/super.c | 4 ++++ 2 files changed, 5 insertions(+)fs/btrfs/fs.h +1
-0@@ -300,6 +300,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 {fs/btrfs/super.c +4
-0@@ -569,6 +569,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 ;
Thanks, Anand
Quoted 9 lines · On Fri, May 09, 2025 at 07:26:31PM +0900, [email protected] wrote:
From: Kyoji Ogasawara <[email protected]>
The Btrfs documentation states that if the commit value is greater than 300 a warning should be issued. This commit implements that functionality. For more details, visit:
https://btrfs.readthedocs.io/en/latest/Administration.html#btrfs-specific-mount-optionsFixes 6941823cc878 ("btrfs: remove old mount API code")Signed-off-by Kyoji Ogasawara <[email protected]>
Added to for-next, thanks.