Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1355485pxb; Tue, 26 Oct 2021 07:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4VLFQhaxfOjPoKhT+FhHIM7IdlmJqNzf7JGdlZmznCR/FbYf3Zt+rK3YCIQWhTxxJCtht X-Received: by 2002:a17:907:3f8a:: with SMTP id hr10mr14274750ejc.373.1635258917588; Tue, 26 Oct 2021 07:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635258917; cv=none; d=google.com; s=arc-20160816; b=r2O4Ri4nasKbGhcb7libb7ToUMA1SVWuJrFLVKUlzvvxtiK0DXfu2v/JBlZXPWKr2V S74GXghppGwpgbcSykXeyOIbYIkQKBX3J2sxzjw47Xk9ux/9i0RoRfCHT0qSIAUmOA/k P37AydqiRcGVED1iTLDrDFurlFMwdgducFgEq8tccxkgsvG5jrsQMnGj5zjWBNb16IRc tace0Q5d+ni2TwZAchm2lFpHcriIgkedyLC9eYwHH7uAmBVHCfGXRUuSA3Dd2248ZeXj SYwgM7x7ZDtM60awhi53IbMn2+LYwHfCm+u/vwupEAXPZguyY2CC5O3GWWw1W90DaVdX aAFA== 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=5/W9nOOsVTKQPhGN/XxpI9Zuf07W5qKbbBlUiMBNdQw=; b=NkvL79P+5UJdMWURinM71ULFongZ9ocG74IOExTIBbbsYBL9AAJDzN8c3QNB3dXxN9 gZRF6sBLhHNB3fKPJgVSvZDDIXQxmvmjFdPnnYah+VJOLlVWLL4aF0lx9cdb+hrxTHDe aHSXCnmiEKXlLW2AwPJnTVGXw5Xw35PqhWwDigkoD1RsRP8Z/hzJAOQeZkFhA4wx22k9 gyqG9s+h+z9FUgdOmJrjPYRptEdc2iFGwM8ZmGT/+fjFN/UIrzi1Psi/BiukAxZMBxiS mPV7QAXUtIgZSDbAMBxK5BRTVD5TXx+6xsk1QZSlZQQ7jZZl93+UNIMf3YAu51qcdlvv 8UJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LBfuNmf8; 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 sc10si164108ejc.650.2021.10.26.07.34.52; Tue, 26 Oct 2021 07:35:17 -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=LBfuNmf8; 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 S235726AbhJZMPR (ORCPT + 99 others); Tue, 26 Oct 2021 08:15:17 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:53016 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235703AbhJZMPQ (ORCPT ); Tue, 26 Oct 2021 08:15:16 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 48B3F1FD42; Tue, 26 Oct 2021 12:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1635250370; 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=5/W9nOOsVTKQPhGN/XxpI9Zuf07W5qKbbBlUiMBNdQw=; b=LBfuNmf8ylGMPMayW/ASdhAYLEL8UmFxTpwj5KNKhkqDUe2iaCFCfxp01Ph6l3XDC6/old QuWpKdGUJzVoa73P2SUxm/UqiaTNrVpnp/A8L1YkZDkbfW5pM3q9Zf7JvA4EH+RsyfOpYx SV4UnxHNvPUw0hExVlhTVPPQ6d4hqVI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1635250370; 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=5/W9nOOsVTKQPhGN/XxpI9Zuf07W5qKbbBlUiMBNdQw=; b=ifSJD/Ziia9owo/XuZOPXsyn6Ee2C3EXCDnY6bdFjcvb+juQd0jQJvpq22qpWV5IcZbMwM EtGx7/GVMJWkG7Bg== Received: from quack2.suse.cz (unknown [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id 32B02A3B81; Tue, 26 Oct 2021 12:12:50 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 08BD91F2C66; Tue, 26 Oct 2021 14:12:50 +0200 (CEST) Date: Tue, 26 Oct 2021 14:12:50 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: amir73il@gmail.com, jack@suse.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v9 29/31] ext4: Send notifications on error Message-ID: <20211026121250.GF21228@quack2.suse.cz> References: <20211025192746.66445-1-krisman@collabora.com> <20211025192746.66445-30-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211025192746.66445-30-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 Mon 25-10-21 16:27:44, Gabriel Krisman Bertazi wrote: > Send a FS_ERROR message via fsnotify to a userspace monitoring tool > whenever a ext4 error condition is triggered. This follows the existing > error conditions in ext4, so it is hooked to the ext4_error* functions. > > Signed-off-by: Gabriel Krisman Bertazi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > Changes since v8: > - Report always report non-zero errno (Jan, Amir, Ted) > Changes since v6: > - Report ext4_std_errors agains superblock (jan) > --- > fs/ext4/super.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index 88d5d274a868..1a766c68a55e 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -46,6 +46,7 @@ > #include > #include > #include > +#include > > #include "ext4.h" > #include "ext4_extents.h" /* Needed for trace points definition */ > @@ -759,6 +760,8 @@ void __ext4_error(struct super_block *sb, const char *function, > sb->s_id, function, line, current->comm, &vaf); > va_end(args); > } > + fsnotify_sb_error(sb, NULL, error ? error : EFSCORRUPTED); > + > ext4_handle_error(sb, force_ro, error, 0, block, function, line); > } > > @@ -789,6 +792,8 @@ void __ext4_error_inode(struct inode *inode, const char *function, > current->comm, &vaf); > va_end(args); > } > + fsnotify_sb_error(inode->i_sb, inode, error ? error : EFSCORRUPTED); > + > ext4_handle_error(inode->i_sb, false, error, inode->i_ino, block, > function, line); > } > @@ -827,6 +832,8 @@ void __ext4_error_file(struct file *file, const char *function, > current->comm, path, &vaf); > va_end(args); > } > + fsnotify_sb_error(inode->i_sb, inode, EFSCORRUPTED); > + > ext4_handle_error(inode->i_sb, false, EFSCORRUPTED, inode->i_ino, block, > function, line); > } > @@ -894,6 +901,7 @@ void __ext4_std_error(struct super_block *sb, const char *function, > printk(KERN_CRIT "EXT4-fs error (device %s) in %s:%d: %s\n", > sb->s_id, function, line, errstr); > } > + fsnotify_sb_error(sb, NULL, errno ? errno : EFSCORRUPTED); > > ext4_handle_error(sb, false, -errno, 0, 0, function, line); > } > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR