Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp594620pxb; Tue, 19 Oct 2021 09:03:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtL1137ucUwcy7Vjrx4u6rlVN0fq4s9ra9khi4L6ZcQmoqQOzMaDL+2LkGNB9Y97xRjF72 X-Received: by 2002:a05:6402:1d55:: with SMTP id dz21mr55426723edb.164.1634659392707; Tue, 19 Oct 2021 09:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634659392; cv=none; d=google.com; s=arc-20160816; b=WZ6iwQMjewga5M4ls5DvljxShPn4kajMIJUiehxhhiHMoat3xthV/NH7TG9R9MJNDh nKz+kJtKhMaZ20bWX772/MuQK05MwmCErZgXjAbMjgUbKeFZyQWs7cqCz5Xxyt1i/d9n qMxuHMoxO3gmgBa3z0a4bPfJMs6bD7qn7hORz0EtxMEWxmd12pHCPIIbiAPWim49nwLG GeqHZbKtNnnGz4DEgrWz9r7jWU9NffUhVx5LHpMiRPkIYTh6uxYEj0A4yH9psj7/uZIK dgztGsikjMfRDTvJc0USCHCFbkdnyY0JvUgHfr5JByUnk0EA7f4auJZcjnoWbLoWKopI 1HVg== 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=8hIx4eb8RNDvqpfcSYXsTTz8oiHfDvbCGCZib+Ictaw=; b=cqZw431UwxQUWZAw5sYwLhL/oPyn+Fq2YHoA48l7wgUN85W1F4paU2NRXHIknyjQT3 tIoXx0w7T/JM0iLDjksx8XACzMYcBq128ivBxZUuN48wc9OHGW53R8WWsoboG2nyl+EA rYgvSyhpwyV6DrCnECxS2RFapEwoMoFNZ3PM7ckDqt0e8VXTHah8AKNbGTkCdkOLiVjs 4ghxBbomiTuR38JAaW4ArcUdM8AJW23nzGV1aWieMtIKTxKhGeqNVQvniZTt8dVNqb7q M2lxv9LQH0c5J8BJM6yYzIrPZSG6/Ky6bNPaux2F1DVKz0SjJLXmFk8BrZGPovCqlU16 oqEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=PpiTBGbB; 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 t17si24642473edi.478.2021.10.19.09.02.46; Tue, 19 Oct 2021 09:03:12 -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=PpiTBGbB; 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 S231750AbhJSQEH (ORCPT + 99 others); Tue, 19 Oct 2021 12:04:07 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:58914 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhJSQEG (ORCPT ); Tue, 19 Oct 2021 12:04:06 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BF6E221981; Tue, 19 Oct 2021 16:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634659312; 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=8hIx4eb8RNDvqpfcSYXsTTz8oiHfDvbCGCZib+Ictaw=; b=PpiTBGbBw0Mz+wxjp3SLGi553EsrgcRkICcmK0CqwPPepfUkV/PdHKAJ8qLFFgkcOIMJM8 iJnqVEBJg1Ama7ybduuDV5zdzQbH9dQzgQeRF6lzIe1t3hUYBbIULHT9i52HJ2S/zhVeuE nkYKeUfyqB0AsLf+vCA2lO9PjxoCchc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634659312; 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=8hIx4eb8RNDvqpfcSYXsTTz8oiHfDvbCGCZib+Ictaw=; b=8bzN2S5Q8vMJhRL9+u61e0yYLZSymEmRUfnEEFU4nwv26As/HmzWbyqtRrzrndJzY8EmhX QCxjlpFles6rxLDQ== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id AA05AA3B8C; Tue, 19 Oct 2021 16:01:52 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 7AF771E0983; Tue, 19 Oct 2021 18:01:52 +0200 (CEST) Date: Tue, 19 Oct 2021 18:01:52 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: jack@suse.com, amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-api@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v8 30/32] ext4: Send notifications on error Message-ID: <20211019160152.GT3255@quack2.suse.cz> References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-31-krisman@collabora.com> <20211019154426.GR3255@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019154426.GR3255@quack2.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 19-10-21 17:44:26, Jan Kara wrote: > On Mon 18-10-21 21:00:13, 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. > > > > Reviewed-by: Amir Goldstein > > Reviewed-by: Theodore Ts'o > > Signed-off-by: Gabriel Krisman Bertazi > > Looks good to me. Feel free to add: > > Reviewed-by: Jan Kara Hum, I actually retract this because the code doesn't match what is written in the documentation and I'm not 100% sure what is correct. In particular: > > @@ -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); > > + E.g. here you pass the 'error' to fsnotify. This will be just standard 'errno' number, not ext4 error code as described in the documentation. Also note that frequently 'error' will be 0 which gets magically transformed to EFSCORRUPTED in save_error_info() in the ext4 error handling below. So there's clearly some more work to do... Honza -- Jan Kara SUSE Labs, CR