Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp468308pxb; Mon, 16 Aug 2021 09:27:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIYGS9w7jI6s2HaKbCat8UKyrynMZQRHYM9MClraBu6PhMJzrb9nXfCyaNudwcBgZA+pCq X-Received: by 2002:a02:2a88:: with SMTP id w130mr16372834jaw.60.1629131221819; Mon, 16 Aug 2021 09:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629131221; cv=none; d=google.com; s=arc-20160816; b=Yp4aDuZGvC8Ao2TjIyn+/MqhAIAvjyBfl99OdjenNgBvy/8W/hHtfdM02dVCbl5foS aiWPzV9fZ6h6BI3g20AfjGT69a9vzrlPOpGXOK+VX/b9MLHNvZSs5ajZ9E/nInBDm1JF WOFGNKf+ggakmjfAesf13YsTV5N2d2T5vpZfBSKkT5qqbF1tVZJjAa+hIiCa0AagPV60 dR1ANpGW+yDMD/GjISKArW42MCHbuRyuRvGWiK64O34T+GWEl9byp5bjkIePBiQvvOCo bRNcisPOsf6yUZIGSZ1tTMAT2J+Z5fsQWaDccPHrBOnX3R9XIIJPk6eAmfHNHiciUiFx QK0Q== 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=AZtW2eLH5Jc4BSlumnFX2rAGLAWiKCRNP7E7mnGiwas=; b=YX1uBYq8oU2SdktoOeq9HnSU6Oy19b9XMnlScZRurTIBlhgtIsuH/YwZUGU+11fe2V wFrW2IlVchfkwey42Va9hU9/gk7h8IISai2LvVxiTdbNssk8N7SWVCmb5/uiqNvmv4ZE lRaM5B+q3xNpIQcsbvComWWGe/4KWzt7GH6w9gLfI1gC9UTu5BE52pgrecuKcJaBy6f7 r7MvV7y1O6JKwgmBLwtbn9XWrateOSC7e8GOKaSPOnRTChomNQtJKt31OysaBf9HHQ1S vJaEfENoB3x7Z7LUGZ5bxzvr9Mnt/qHQdM+clh/IoRmi2rOCHre7nFSOIRcBa3Nk5Y8l O34Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P2zBM7aV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=A2oVdEY7; 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 r17si11284725iln.147.2021.08.16.09.26.47; Mon, 16 Aug 2021 09:27:01 -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=P2zBM7aV; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=A2oVdEY7; 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 S229737AbhHPQ0v (ORCPT + 99 others); Mon, 16 Aug 2021 12:26:51 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:46490 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbhHPQ0u (ORCPT ); Mon, 16 Aug 2021 12:26:50 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EAA1D1FF97; Mon, 16 Aug 2021 16:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629131177; 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=AZtW2eLH5Jc4BSlumnFX2rAGLAWiKCRNP7E7mnGiwas=; b=P2zBM7aVl9bt1cLchKdLrLR8BsistDtqUsKhKMaI+E4Cug1Dgmft6/i9wzJtvtIQZo0ZSs cCjQlP3qiUR8Ed1X6lZZRzAjoeLIvjdClWkzjhsRvMtazzTHDLc0xw4M92SkizeILa+i8h tWwQd0uM+2QrlK21PR+0bdjZmA0aHrw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629131177; 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=AZtW2eLH5Jc4BSlumnFX2rAGLAWiKCRNP7E7mnGiwas=; b=A2oVdEY7DFwQYE/Tc8AoYVdDbdePd8JwwKD+YBbGzG5TcvZNs/ce2LhK3KYAzBHopk7QU6 ZpQH+LA8r97/IkAA== Received: from quack2.suse.cz (jack.udp.ovpn1.prg.suse.de [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id D3B58A3B8F; Mon, 16 Aug 2021 16:26:17 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 46EA01E0426; Mon, 16 Aug 2021 18:26:15 +0200 (CEST) Date: Mon, 16 Aug 2021 18:26:15 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: amir73il@gmail.com, jack@suse.com, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, khazhy@google.com, dhowells@redhat.com, david@fromorbit.com, tytso@mit.edu, djwong@kernel.org, repnop@google.com, kernel@collabora.com Subject: Re: [PATCH v6 19/21] ext4: Send notifications on error Message-ID: <20210816162615.GJ30215@quack2.suse.cz> References: <20210812214010.3197279-1-krisman@collabora.com> <20210812214010.3197279-20-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210812214010.3197279-20-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 Thu 12-08-21 17:40:08, 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. > > It also follows the current dmesg reporting in the format. The > filesystem message is composed mostly by the string that would be > otherwise printed in dmesg. > > A new ext4 specific record format is exposed in the uapi, such that a > monitoring tool knows what to expect when listening errors of an ext4 > filesystem. > > Signed-off-by: Gabriel Krisman Bertazi > Reviewed-by: Amir Goldstein > --- > fs/ext4/super.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > diff --git a/fs/ext4/super.c b/fs/ext4/super.c > index dfa09a277b56..b9ecd43678d7 100644 > --- a/fs/ext4/super.c > +++ b/fs/ext4/super.c > @@ -897,6 +904,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, sb->s_root->d_inode, errno); > > ext4_handle_error(sb, false, -errno, 0, 0, function, line); > } Does it make sense to report root inode here? ext4_std_error() gets generally used for filesystem-wide errors. Honza -- Jan Kara SUSE Labs, CR