Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp341777pxv; Thu, 8 Jul 2021 03:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBA4Xma8Lhtgqataaq1tFZloavBBeuKfv1hopdQoSH3JVG9YtOdX8DEj2yE8e250J1eUF5 X-Received: by 2002:a92:dc8e:: with SMTP id c14mr5554847iln.91.1625741670994; Thu, 08 Jul 2021 03:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625741670; cv=none; d=google.com; s=arc-20160816; b=De/y3xDrrM1l4suEShz2M+qb3v84igYD5ZG1v2V3f1KrFQp4tW2Db65OZ9VlnUd9JV U7L3mb/4F7FT8hW82jq6Gu2VmT7+XyrSt5rdya82rTSIUqESkkYM2xw7obvbwrK2Qu5K ZrjXI0+hW165ITcbwYR3anLf3BKwKah2oX4e/fqZNy6TB5+onlgXYqc6k5umkKO5xOWT cj0eUafKaFEOXHiG26cbgv4LVoMjlabSu9eJ6MZCU9y2pugZkWgQ9p6AP8DpcnGVfqIg zl0kzxHEjl7gVsVB4UqS5vB8reGZnSxgCYDw5YMYS5anrUWDF4OaEuZ15s1y+J0iN4vh 5YTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=+mquy67D6sfM4ufamIrhfw0Nc9sWsE9LURl98iAYttg=; b=HKF8z/3QSBONUdlUPawQKtsZ+AOTQI4vXBvAG9SnN6AArT+IKK74kScD6tc21FUA/s Bl1l9c89KOBTv4xWIGq+4mbvCzU79OmH6YlXe7Pzq0QRr6o8lxN8FTyu5TEDrWcrroPC aGK3N+3IArv6ZSMbmuXq4cNEYfEd+ecsvvjy6bzXnxVK8ZLqBfctYu3bLgTnDH5EDBvt JMYJkse8646o4D6ta1iJDMPUt5wZ79dCCNpSewublLfTeG4F9uSlhSL0R5jNoAugL4Gb P3uTLMDCTExVLp0VTO6bz6ZHupRH88p77728emNmnO5mdMVbFt7KSiydKGsWGd3hzBTe oc6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vtvIwVBF; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b8si2019760ils.92.2021.07.08.03.54.18; Thu, 08 Jul 2021 03:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vtvIwVBF; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbhGHK4S (ORCPT + 99 others); Thu, 8 Jul 2021 06:56:18 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:50312 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbhGHK4S (ORCPT ); Thu, 8 Jul 2021 06:56:18 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BB6D1220DD; Thu, 8 Jul 2021 10:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1625741615; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+mquy67D6sfM4ufamIrhfw0Nc9sWsE9LURl98iAYttg=; b=vtvIwVBFg1lbnd4n1znfvL3HMm9qhg/P6BH0mm7aZr2E0edtQVs9q6E5QalONecX/epRCU lWy8BhVqQuhrStQQEx0G4MWBey6kZ3oev9v2XjdANfZJmIRbFeEdAs+13n2FZD70YL1jc3 TTFRpyRGJBzXX4W80U3K85Aeg4fjh9I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1625741615; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+mquy67D6sfM4ufamIrhfw0Nc9sWsE9LURl98iAYttg=; b=koRC34SOaWckw5M0scomqd5WA+Wid0QlkAH+LIBxp9HmLB5yXwoa1N6zE4704PN30YbJrk 4et31w4xZiwHHACw== Received: from quack2.suse.cz (unknown [10.163.43.118]) by relay2.suse.de (Postfix) with ESMTP id 9BBF2A3B8B; Thu, 8 Jul 2021 10:53:35 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8526A1E62E4; Thu, 8 Jul 2021 12:53:35 +0200 (CEST) Date: Thu, 8 Jul 2021 12:53:35 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v3 10/15] fsnotify: Support FS_ERROR event type Message-ID: <20210708105335.GC1656@quack2.suse.cz> References: <20210629191035.681913-1-krisman@collabora.com> <20210629191035.681913-11-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210629191035.681913-11-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 29-06-21 15:10:30, Gabriel Krisman Bertazi wrote: > Expose a new type of fsnotify event for filesystems to report errors for > userspace monitoring tools. fanotify will send this type of > notification for FAN_FS_ERROR events. > > Reviewed-by: Amir Goldstein > Signed-off-by: Gabriel Krisman Bertazi Looks sensible. Feel free to add: Reviewed-by: Jan Kara Honza > > --- > Changes since v2: > - FAN_ERROR->FAN_FS_ERROR (Amir) > > Changes since v1: > - Overload FS_ERROR with FS_IN_IGNORED > - Implement support for this type on fsnotify_data_inode (Amir) > --- > include/linux/fsnotify_backend.h | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h > index 8222fe12a6c9..ea5f5c7cc381 100644 > --- a/include/linux/fsnotify_backend.h > +++ b/include/linux/fsnotify_backend.h > @@ -42,6 +42,12 @@ > > #define FS_UNMOUNT 0x00002000 /* inode on umount fs */ > #define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ > +#define FS_ERROR 0x00008000 /* Filesystem Error (fanotify) */ > + > +/* > + * FS_IN_IGNORED overloads FS_ERROR. It is only used internally by inotify > + * which does not support FS_ERROR. > + */ > #define FS_IN_IGNORED 0x00008000 /* last inotify event here */ > > #define FS_OPEN_PERM 0x00010000 /* open event in an permission hook */ > @@ -95,7 +101,8 @@ > #define ALL_FSNOTIFY_EVENTS (ALL_FSNOTIFY_DIRENT_EVENTS | \ > FS_EVENTS_POSS_ON_CHILD | \ > FS_DELETE_SELF | FS_MOVE_SELF | FS_DN_RENAME | \ > - FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED) > + FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ > + FS_ERROR) > > /* Extra flags that may be reported with event or control handling of events */ > #define ALL_FSNOTIFY_FLAGS (FS_EXCL_UNLINK | FS_ISDIR | FS_IN_ONESHOT | \ > @@ -263,6 +270,12 @@ enum fsnotify_data_type { > FSNOTIFY_EVENT_NONE, > FSNOTIFY_EVENT_PATH, > FSNOTIFY_EVENT_INODE, > + FSNOTIFY_EVENT_ERROR, > +}; > + > +struct fs_error_report { > + int error; > + struct inode *inode; > }; > > static inline struct inode *fsnotify_data_inode(const void *data, int data_type) > @@ -272,6 +285,8 @@ static inline struct inode *fsnotify_data_inode(const void *data, int data_type) > return (struct inode *)data; > case FSNOTIFY_EVENT_PATH: > return d_inode(((const struct path *)data)->dentry); > + case FSNOTIFY_EVENT_ERROR: > + return ((struct fs_error_report *)data)->inode; > default: > return NULL; > } > -- > 2.32.0 > -- Jan Kara SUSE Labs, CR