From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Gabriel Krisman Bertazi <krisman@collabora.com>
Cc: David Howells <dhowells@redhat.com>,
viro@zeniv.linux.org.uk, tytso@mit.edu, khazhy@google.com,
adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
linux-fsdevel@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCH 5/8] vfs: Include origin of the SB error notification
Date: Tue, 8 Dec 2020 10:41:23 -0800 [thread overview]
Message-ID: <20201208184123.GC106255@magnolia> (raw)
In-Reply-To: <87r1o05ua6.fsf@collabora.com>
On Tue, Dec 08, 2020 at 09:58:25AM -0300, Gabriel Krisman Bertazi wrote:
> David Howells <dhowells@redhat.com> writes:
>
> > Gabriel Krisman Bertazi <krisman@collabora.com> wrote:
> >
> >> @@ -130,6 +131,8 @@ struct superblock_error_notification {
FWIW I wonder if this really should be inode_error_notification?
If (for example) ext4 discovered an error in the blockgroup descriptor
and wanted to report it, the inode and block numbers would be
irrelevant, but the blockgroup number would be nice to have.
> >> __u32 error_cookie;
> >> __u64 inode;
> >> __u64 block;
> >> + char function[SB_NOTIFICATION_FNAME_LEN];
> >> + __u16 line;
> >> char desc[0];
> >> };
> >
> > As Darrick said, this is a UAPI breaker, so you shouldn't do this (you can,
> > however, merge this ahead a patch). Also, I would put the __u16 before the
> > char[].
> >
> > That said, I'm not sure whether it's useful to include the function name and
> > line. Both fields are liable to change over kernel commits, so it's not
> > something userspace can actually interpret. I think you're better off dumping
> > those into dmesg.
> >
> > Further, this reduces the capacity of desc[] significantly - I don't know if
> > that's a problem.
>
> Yes, that is a big problem as desc is already quite limited. I don't
How limited?
> think it is a problem for them to change between kernel versions, as the
> monitoring userspace can easily associate it with the running kernel.
How do you make that association? $majordistro's 4.18 kernel is not the
same as the upstream 4.18. Wouldn't you rather the notification message
be entirely self-describing rather than depending on some external
information about the sender?
> The alternative would be generating something like unique IDs for each
> error notification in the filesystem, no?
>
> > And yet further, there's no room for addition of new fields with the desc[]
> > buffer on the end. Now maybe you're planning on making use of desc[] for
> > text-encoding?
>
> Yes. I would like to be able to provide more details on the error,
> without having a unique id. For instance, desc would have the formatted
> string below, describing the warning:
>
> ext4_warning(inode->i_sb, "couldn't mark inode dirty (err %d)", err);
Depending on the upper limit on the length of messages, I wonder if you
could split the superblock notification and the description string into
separate messages (with maybe the error cookie to tie them together) so
that the struct isn't limited by having a VLA on the end, and the
description can be more or less an arbitrary string?
(That said I'm not familiar with the watch queue system so I have no
idea if chained messages even make sense here, or are already
implemented in some other way, or...)
Even better if you could find a way to send the string and the arguments
separately so that whatever's on the receiving end could run it through
a localization catalogue. Though I remember my roommates trying to
localize 2.0.35 into Latin 25 years ago and never getting very far. :)
--D
>
>
> >
> > David
> >
>
> --
> Gabriel Krisman Bertazi
next prev parent reply other threads:[~2020-12-08 21:09 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 0:31 [PATCH 0/8] Superblock Notifications Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 1/8] watch_queue: Make watch_sizeof() check record size Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 2/8] security: Add hooks to rule on setting a watch for superblock Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 3/8] watch_queue: Support a text field at the end of the notification Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 4/8] vfs: Add superblock notifications Gabriel Krisman Bertazi
2020-12-08 0:56 ` Darrick J. Wong
2020-12-10 22:09 ` Dave Chinner
2020-12-11 20:55 ` Gabriel Krisman Bertazi
2020-12-18 1:06 ` Dave Chinner
2021-01-05 19:52 ` Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 5/8] vfs: Include origin of the SB error notification Gabriel Krisman Bertazi
2020-12-08 0:51 ` Darrick J. Wong
2020-12-08 0:55 ` Gabriel Krisman Bertazi
2020-12-08 12:42 ` David Howells
2020-12-08 0:31 ` [PATCH 6/8] fs: Add more superblock error subtypes Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 7/8] ext4: Implement SB error notification through watch_sb Gabriel Krisman Bertazi
2020-12-08 0:31 ` [PATCH 8/8] samples: watch_queue: Add sample of SB notifications Gabriel Krisman Bertazi
2020-12-08 12:51 ` [PATCH 5/8] vfs: Include origin of the SB error notification David Howells
2020-12-08 12:58 ` Gabriel Krisman Bertazi
2020-12-08 18:41 ` Darrick J. Wong [this message]
2020-12-08 19:29 ` Gabriel Krisman Bertazi
2020-12-09 3:24 ` Darrick J. Wong
2020-12-09 13:06 ` Gabriel Krisman Bertazi
2020-12-11 22:35 ` Darrick J. Wong
2020-12-08 12:57 ` [PATCH 3/8] watch_queue: Support a text field at the end of the notification David Howells
2020-12-08 12:59 ` [PATCH 0/8] Superblock Notifications David Howells
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=20201208184123.GC106255@magnolia \
--to=darrick.wong@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=dhowells@redhat.com \
--cc=kernel@collabora.com \
--cc=khazhy@google.com \
--cc=krisman@collabora.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).