[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210816161818.GH30215@quack2.suse.cz>
Date: Mon, 16 Aug 2021 18:18:18 +0200
From: Jan Kara <jack@...e.cz>
To: Gabriel Krisman Bertazi <krisman@...labora.com>
Cc: amir73il@...il.com, jack@...e.com, linux-api@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
khazhy@...gle.com, dhowells@...hat.com, david@...morbit.com,
tytso@....edu, djwong@...nel.org, repnop@...gle.com,
kernel@...labora.com
Subject: Re: [PATCH v6 17/21] fanotify: Report fid info for file related file
system errors
On Thu 12-08-21 17:40:06, Gabriel Krisman Bertazi wrote:
> Plumb the pieces to add a FID report to error records. Since all error
> event memory must be pre-allocated, we estimate a file handle size and
> if it is insuficient, we report an invalid FID and increase the
> prediction for the next error slot allocation.
This needs updating. The code now uses MAX_HANDLE_SZ...
> For errors that don't expose a file handle report it with an invalid
> FID.
>
> Signed-off-by: Gabriel Krisman Bertazi <krisman@...labora.com>
>
> ---
> Changes since v5:
> - Use preallocated MAX_HANDLE_SZ FH buffer
> - Report superblock errors with a zerolength INVALID FID (jan, amir)
> ---
> fs/notify/fanotify/fanotify.c | 15 +++++++++++++++
> fs/notify/fanotify/fanotify.h | 11 +++++++++++
> fs/notify/fanotify/fanotify_user.c | 7 +++++++
> 3 files changed, 33 insertions(+)
>
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index 0c7667d3f5d1..f5c16ac37835 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -734,6 +734,8 @@ static int fanotify_handle_error_event(struct fsnotify_iter_info *iter_info,
> struct fanotify_sb_mark *sb_mark =
> FANOTIFY_SB_MARK(fsnotify_iter_sb_mark(iter_info));
> struct fanotify_error_event *fee = sb_mark->fee_slot;
> + struct inode *inode = report->inode;
> + int fh_len;
>
> spin_lock(&group->notification_lock);
> if (fee->err_count++) {
> @@ -743,6 +745,19 @@ static int fanotify_handle_error_event(struct fsnotify_iter_info *iter_info,
> spin_unlock(&group->notification_lock);
>
> fee->fae.type = FANOTIFY_EVENT_TYPE_FS_ERROR;
> + fee->fsid = fee->sb_mark->fsn_mark.connector->fsid;
Why don't you use sb_mark directly?
Otherwise the patch looks good to me.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists