diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-05-27 10:31:34 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-05-27 10:31:34 +1000 |
commit | df5660cf63bbafb5a1250954b91d9ec26558536f (patch) | |
tree | 3bfddaf614c9ad7b3d6e7a888a45885c260f6697 /fs/xfs/xfs_fsops.c | |
parent | 374037966d661d62139a8b6fd33f42fc2038a1e6 (diff) | |
download | linux-df5660cf63bbafb5a1250954b91d9ec26558536f.tar.gz linux-df5660cf63bbafb5a1250954b91d9ec26558536f.tar.bz2 linux-df5660cf63bbafb5a1250954b91d9ec26558536f.zip |
xfs: implement per-mount warnings for scrub and shrink usage
Currently, we don't have a consistent story around logging when an
EXPERIMENTAL feature gets turned on at runtime -- online fsck and shrink
log a message once per day across all mounts, and the recently merged
LARP mode only ever does it once per insmod cycle or reboot.
Because EXPERIMENTAL tags are supposed to go away eventually, convert
the existing daily warnings into state flags that travel with the mount,
and warn once per mount. Making this an opstate flag means that we'll
be able to capture the experimental usage in the ftrace output too.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 888839e75d11..d4a77c53f94b 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -149,12 +149,7 @@ xfs_growfs_data_private( error = xfs_resizefs_init_new_ags(tp, &id, oagcount, nagcount, delta, &lastag_extended); } else { - static struct ratelimit_state shrink_warning = \ - RATELIMIT_STATE_INIT("shrink_warning", 86400 * HZ, 1); - ratelimit_set_flags(&shrink_warning, RATELIMIT_MSG_ON_RELEASE); - - if (__ratelimit(&shrink_warning)) - xfs_alert(mp, + xfs_warn_mount(mp, XFS_OPSTATE_WARNED_SHRINK, "EXPERIMENTAL online shrink feature in use. Use at your own risk!"); error = xfs_ag_shrink_space(mp, &tp, nagcount - 1, -delta); |