Skip to contentSkip to conversation

xfs: allow setting full range of panic tags

PATCH Superseded Donald Douwsma 2 participants 3 messages Jan 25, 2023 – Jan 26, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: allow setting full range of panic tags

xfs will not allow combining other panic values 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.

Fixes d519da41e2b78 ("xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask")
---
 Documentation/admin-guide/xfs.rst | 2 +-
 fs/xfs/xfs_globals.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/xfs.rst +1 -1
index 8de008c0c5ad..e2561416391c 100644
@@ -296,7 +296,7 @@ The following sysctls are available for the XFS filesystem:
 		XFS_ERRLEVEL_LOW:       1
 		XFS_ERRLEVEL_HIGH:      5
 
-  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 256)
+  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 511)
 	Causes certain error conditions to call BUG(). Value is a bitmask;
 	OR together the tags which represent errors which should cause panics:
 
fs/xfs/xfs_globals.c +1 -1
index 4d0a98f920ca..e0e9494a8251 100644
@@ -15,7 +15,7 @@ xfs_param_t xfs_params = {
 			  /*	MIN		DFLT		MAX	*/
 	.sgid_inherit	= {	0,		0,		1	},
 	.symlink_mode	= {	0,		0,		1	},
-	.panic_mask	= {	0,		0,		256	},
+	.panic_mask	= {	0,		0,		511	},
 	.error_level	= {	0,		3,		11	},
 	.syncd_timer	= {	1*100,		30*100,		7200*100},
 	.stats_clear	= {	0,		0,		1	},
Signature · 1 line
2.31.1
#1 lore raw
Quoted 33 lines · Donald Douwsma

xfs will not allow combining other panic values 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.

Fixes d519da41e2b78 ("xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask")
---
 Documentation/admin-guide/xfs.rst | 2 +-
 fs/xfs/xfs_globals.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/xfs.rst +1 -1
index 8de008c0c5ad..e2561416391c 100644
@@ -296,7 +296,7 @@ The following sysctls are available for the XFS filesystem:
 		XFS_ERRLEVEL_LOW:       1
 		XFS_ERRLEVEL_HIGH:      5
 
-  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 256)
+  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 511)
 	Causes certain error conditions to call BUG(). Value is a bitmask;
 	OR together the tags which represent errors which should cause panics:
 
fs/xfs/xfs_globals.c +0 -0
index 4d0a98f920ca..e0e9494a8251 100644

fs/xfs/xfs_globals.c xfs_param_t xfs_params = { · line 18

Quoted 5 lines
fs/xfs/xfs_globals.c +1 -1
@@ -15,7 +15,7 @@ xfs_param_t xfs_params = {
 			  /*	MIN		DFLT		MAX	*/
 	.sgid_inherit	= {	0,		0,		1	},
 	.symlink_mode	= {	0,		0,		1	},
-	.panic_mask	= {	0,		0,		256	},
+	.panic_mask	= {	0,		0,		511	},

Why not fix this by defining an XFS_PTAG_ALL_MASK that combines all valid flags and use that here? That way we eliminate this class of bug.

Looking at d519da41e2b78, the maintainers suck at noticing these kinds of mistakes.

--D

Quoted 6 lines
fs/xfs/xfs_globals.c +0 -0
 	.error_level	= {	0,		3,		11	},
 	.syncd_timer	= {	1*100,		30*100,		7200*100},
 	.stats_clear	= {	0,		0,		1	},
Signature · 1 line
2.31.1
#2 lore raw
Quoted 29 lines · Darrick J. Wong
Quoted 28 lines · Donald Douwsma

xfs will not allow combining other panic values 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.

Fixes d519da41e2b78 ("xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask")
---
  Documentation/admin-guide/xfs.rst | 2 +-
  fs/xfs/xfs_globals.c              | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/admin-guide/xfs.rst +1 -1
index 8de008c0c5ad..e2561416391c 100644
@@ -296,7 +296,7 @@ The following sysctls are available for the XFS filesystem:
  		XFS_ERRLEVEL_LOW:       1
  		XFS_ERRLEVEL_HIGH:      5
 
-  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 256)
+  fs.xfs.panic_mask		(Min: 0  Default: 0  Max: 511)
  	Causes certain error conditions to call BUG(). Value is a bitmask;
  	OR together the tags which represent errors which should cause panics:
 
Quoted 13 lines

fs/xfs/xfs_globals.c xfs_param_t xfs_params = { · line 18

Quoted 10 lines
fs/xfs/xfs_globals.c +1 -1
index 4d0a98f920ca..e0e9494a8251 100644
@@ -15,7 +15,7 @@ xfs_param_t xfs_params = {
  			  /*	MIN		DFLT		MAX	*/
  	.sgid_inherit	= {	0,		0,		1	},
  	.symlink_mode	= {	0,		0,		1	},
-	.panic_mask	= {	0,		0,		256	},
+	.panic_mask	= {	0,		0,		511	},

Why not fix this by defining an XFS_PTAG_ALL_MASK that combines all valid flags and use that here? That way we eliminate this class of bug.

Sure, perhaps XFS_MAX_PTAG to fit with its use in xfs_params?

Quoted 3 lines

Looking at d519da41e2b78, the maintainers suck at noticing these kinds of mistakes.

The interface is problematic in the field too, folks were using 256 to mean all, and wondered why they weren't hitting anything, including XFS_PTAG_SHUTDOWN_CORRUPT. I'll OR together the masks to be clear with respect to the documentation.

Don

Quoted 10 lines

--D

Quoted 6 lines
fs/xfs/xfs_globals.c +0 -0
  	.error_level	= {	0,		3,		11	},
  	.syncd_timer	= {	1*100,		30*100,		7200*100},
  	.stats_clear	= {	0,		0,		1	},
Signature · 1 line
2.31.1