Skip to content

Commit 167ce4c

Browse files
ddouwsmaDarrick J. Wong
authored andcommitted
xfs: allow setting full range of panic tags
xfs will not allow combining other panic masks with XFS_PTAG_VERIFIER_ERROR. # sysctl fs.xfs.panic_mask=511 sysctl: setting key "fs.xfs.panic_mask": Invalid argument fs.xfs.panic_mask = 511 Update to the maximum value that can be set to allow the full range of masks. Do this using a mask of possible values to prevent this happening again as suggested by Darrick. Fixes: d519da4 ("xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask") Signed-off-by: Donald Douwsma <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent c85007e commit 167ce4c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Documentation/admin-guide/xfs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ The following sysctls are available for the XFS filesystem:
296296
XFS_ERRLEVEL_LOW: 1
297297
XFS_ERRLEVEL_HIGH: 5
298298

299-
fs.xfs.panic_mask (Min: 0 Default: 0 Max: 256)
299+
fs.xfs.panic_mask (Min: 0 Default: 0 Max: 511)
300300
Causes certain error conditions to call BUG(). Value is a bitmask;
301301
OR together the tags which represent errors which should cause panics:
302302

fs/xfs/xfs_error.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern int xfs_errortag_clearall(struct xfs_mount *mp);
7575

7676
/*
7777
* XFS panic tags -- allow a call to xfs_alert_tag() be turned into
78-
* a panic by setting xfs_panic_mask in a sysctl.
78+
* a panic by setting fs.xfs.panic_mask in a sysctl.
7979
*/
8080
#define XFS_NO_PTAG 0u
8181
#define XFS_PTAG_IFLUSH (1u << 0)
@@ -88,6 +88,16 @@ extern int xfs_errortag_clearall(struct xfs_mount *mp);
8888
#define XFS_PTAG_FSBLOCK_ZERO (1u << 7)
8989
#define XFS_PTAG_VERIFIER_ERROR (1u << 8)
9090

91+
#define XFS_PTAG_MASK (XFS_PTAG_IFLUSH | \
92+
XFS_PTAG_LOGRES | \
93+
XFS_PTAG_AILDELETE | \
94+
XFS_PTAG_ERROR_REPORT | \
95+
XFS_PTAG_SHUTDOWN_CORRUPT | \
96+
XFS_PTAG_SHUTDOWN_IOERROR | \
97+
XFS_PTAG_SHUTDOWN_LOGERROR | \
98+
XFS_PTAG_FSBLOCK_ZERO | \
99+
XFS_PTAG_VERIFIER_ERROR)
100+
91101
#define XFS_PTAG_STRINGS \
92102
{ XFS_NO_PTAG, "none" }, \
93103
{ XFS_PTAG_IFLUSH, "iflush" }, \

fs/xfs/xfs_globals.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* All Rights Reserved.
55
*/
66
#include "xfs.h"
7+
#include "xfs_error.h"
78

89
/*
910
* Tunable XFS parameters. xfs_params is required even when CONFIG_SYSCTL=n,
@@ -15,7 +16,7 @@ xfs_param_t xfs_params = {
1516
/* MIN DFLT MAX */
1617
.sgid_inherit = { 0, 0, 1 },
1718
.symlink_mode = { 0, 0, 1 },
18-
.panic_mask = { 0, 0, 256 },
19+
.panic_mask = { 0, 0, XFS_PTAG_MASK},
1920
.error_level = { 0, 3, 11 },
2021
.syncd_timer = { 1*100, 30*100, 7200*100},
2122
.stats_clear = { 0, 0, 1 },

0 commit comments

Comments
 (0)