summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_message.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-05-27 02:31:34 +0200
committerDave Chinner <david@fromorbit.com>2022-05-27 02:31:34 +0200
commitdf5660cf63bbafb5a1250954b91d9ec26558536f (patch)
tree3bfddaf614c9ad7b3d6e7a888a45885c260f6697 /fs/xfs/xfs_message.h
parentxfs: don't log every time we clear the log incompat flags (diff)
downloadlinux-df5660cf63bbafb5a1250954b91d9ec26558536f.tar.xz
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_message.h')
-rw-r--r--fs/xfs/xfs_message.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/xfs/xfs_message.h b/fs/xfs/xfs_message.h
index 55ee464ab59f..cc323775a12c 100644
--- a/fs/xfs/xfs_message.h
+++ b/fs/xfs/xfs_message.h
@@ -75,6 +75,12 @@ do { \
#define xfs_debug_ratelimited(dev, fmt, ...) \
xfs_printk_ratelimited(xfs_debug, dev, fmt, ##__VA_ARGS__)
+#define xfs_warn_mount(mp, warntag, fmt, ...) \
+do { \
+ if (xfs_should_warn((mp), (warntag))) \
+ xfs_warn((mp), (fmt), ##__VA_ARGS__); \
+} while (0)
+
#define xfs_warn_once(dev, fmt, ...) \
xfs_printk_once(xfs_warn, dev, fmt, ##__VA_ARGS__)
#define xfs_notice_once(dev, fmt, ...) \