From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: Donald Douwsma <ddouwsma@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v2] xfs: allow setting full range of panic tags
Date: Tue, 31 Jan 2023 11:28:08 -0800 [thread overview]
Message-ID: <Y9lryDchO2EWw4Nj@magnolia> (raw)
In-Reply-To: <25c4d75a-ef1a-c8a5-6c9c-0549ebd0edc2@sandeen.net>
On Mon, Jan 30, 2023 at 04:20:00PM -0600, Eric Sandeen wrote:
> On 1/27/23 10:27 AM, Darrick J. Wong wrote:
> > On Thu, Jan 26, 2023 at 04:29:10PM +1100, Donald Douwsma wrote:
> >> 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.
> >>
> >> Fixes: d519da41e2b7 ("xfs: Introduce XFS_PTAG_VERIFIER_ERROR panic mask")
>
> whoops :)
>
> I wonder ...
>
> >> Signed-off-by: Donald Douwsma <ddouwsma@redhat.com>
>
> ...
>
> > The ptag values are a bitmask, not a continuous integer range, so the
> > name should have "MASK" in it, e.g.
> >
> > #define XFS_PTAG_MASK (XFS_PTAG_IFLUSH | \
> > XFS_PTAG_LOGRES | \
> > ...
> >
> > and follow the customary style where the macro definition lines are
> > indented from the name.
> >
> > Otherwise this looks fine.
> >
> > --D
> >
> >> +#define XFS_MAX_PTAG ( \
> >> + XFS_PTAG_IFLUSH | \
> >> + XFS_PTAG_LOGRES | \
> >> + XFS_PTAG_AILDELETE | \
> >> + XFS_PTAG_ERROR_REPORT | \
> >> + XFS_PTAG_SHUTDOWN_CORRUPT | \
> >> + XFS_PTAG_SHUTDOWN_IOERROR | \
> >> + XFS_PTAG_SHUTDOWN_LOGERROR | \
> >> + XFS_PTAG_FSBLOCK_ZERO | \
> >> + XFS_PTAG_VERIFIER_ERROR)
> >> +
>
> ...
>
> >> + .panic_mask = { 0, 0, XFS_MAX_PTAG},
> >> .error_level = { 0, 3, 11 },
> >> .syncd_timer = { 1*100, 30*100, 7200*100},
> >> .stats_clear = { 0, 0, 1 },
>
> Do we really gain anything by carefully crafting the max bit that can be set here?
> Nothing stops someone from forgetting to update XFS_MAX_PTAG (or whatever it
> may be named) in the future,
That's true, but every other _ALL and _MASK define in the xfs codebase
also have that problem. *Most* of the time people remember to update
it.
> and I think nothing bad happens if you try to turn
> on a PTAG that doesn't exist. Should we just set it to LONG_MAX and be done with
> it?
That would break the existing input validation:
# echo 1023 > /proc/sys/fs/xfs/panic_mask
-bash: echo: write error: Invalid argument
--D
> (I guess it's maybe nice to tell the user that they're out of range, but it is
> a debug knob after all. Just a thought, I'm ot super picky about this.)
> -Eric
prev parent reply other threads:[~2023-01-31 19:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 5:29 [PATCH v2] xfs: allow setting full range of panic tags Donald Douwsma
2023-01-27 16:27 ` Darrick J. Wong
2023-01-30 22:20 ` Eric Sandeen
2023-01-31 19:28 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9lryDchO2EWw4Nj@magnolia \
--to=djwong@kernel.org \
--cc=ddouwsma@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.