Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp275854pxb; Wed, 27 Oct 2021 02:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy80jWkBEZUln6o2ok29PD3PHoa7c8J0KA7HdXNoCwb48dpvvhZTlYZdFSttHA7u13UQ359 X-Received: by 2002:a05:6402:3512:: with SMTP id b18mr42756718edd.15.1635328356283; Wed, 27 Oct 2021 02:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635328356; cv=none; d=google.com; s=arc-20160816; b=lCcJQlkmOgujd0T0A5/lojmcHky4HqBeGMZClJP6/sS1kEXpkdaiNFybaZzSgiffFV Rnsfx9O8hM/ZAMGC15VPRLhufD5sla8vzZluJueTXlDrbUnfNCTryyolxel8QWtjWip3 J0VBs04DhdCrO+dNpGFruxt62N0UPJCVA+Jbfv6njzp02akwscrRyAjD2nvgESpmZyAW YkdtrZljxgWY1lWawBQ3K7I4JAWUNol5xXO5Ghp8HOlnKrmb3k5a69pHZU20qRLYy89/ jDGdhzqbybau4JyHMq1RU3EFna8WVxkDcy87W69CB50InWkO6a4NcSYKrde34GLrRzLj Icrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=zBHYFNAAQ++iuIEZUQtTLx7EdemxAGBsQaq9roiziyo=; b=DjAR3LVcvDryW44YBEX8lEYULCmx2ECucJuxt7ZcsTTDLr6gSK4pmAOnY6Gm6ggtCf SDc+8OymMKCMVnZJ2Pzf6dgScfVe/WXPN1sQ5qVxPmgWOgOVCnokGGj7IL2Ljeli1VI1 kiA53kxVPYyxGPcVWqQlv9woQo8wGmisWRORPdapJiNeXZpMMzfBRpxC7UYh7vPhbOaE scO0fpwm3MtdgBwNrxEgEvEbv4MnK5BLYR7NWPVF5tJeQJcT3IxKCtkBHtW0Es/6XGkC KU/MvQpUhk4KpXZRSLlMj2I+uCgOVgCMEFMSSfrP6+emIW1C+155dXENW6UArLDgnbVS Ht3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 f14si28524835ejx.422.2021.10.27.02.52.12; Wed, 27 Oct 2021 02:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235125AbhJZTjK convert rfc822-to-8bit (ORCPT + 99 others); Tue, 26 Oct 2021 15:39:10 -0400 Received: from lithops.sigma-star.at ([195.201.40.130]:58762 "EHLO lithops.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233819AbhJZTjJ (ORCPT ); Tue, 26 Oct 2021 15:39:09 -0400 Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 6AC6361EAE61; Tue, 26 Oct 2021 21:36:44 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7wGUL2xiZPGU; Tue, 26 Oct 2021 21:36:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id EA44561EAE60; Tue, 26 Oct 2021 21:36:43 +0200 (CEST) Received: from lithops.sigma-star.at ([127.0.0.1]) by localhost (lithops.sigma-star.at [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id QBTsJ4QC7-1X; Tue, 26 Oct 2021 21:36:43 +0200 (CEST) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id C1881608890D; Tue, 26 Oct 2021 21:36:43 +0200 (CEST) Date: Tue, 26 Oct 2021 21:36:43 +0200 (CEST) From: Richard Weinberger To: schaecsn Cc: linux-mtd , linux-kernel , Stefan Schaeckeler Message-ID: <2065858791.38760.1635277003599.JavaMail.zimbra@nod.at> In-Reply-To: <20211010042239.2888-1-schaecsn@gmx.net> References: <20211010042239.2888-1-schaecsn@gmx.net> Subject: Re: [PATCH v2] ubifs: ubifs to export filesystem error counters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [195.201.40.130] X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF93 (Linux)/8.8.12_GA_3809) Thread-Topic: ubifs: ubifs to export filesystem error counters Thread-Index: aM4D8UF/9n8qFEnXdnQOShonLtWUPw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stefan, ----- Ursprüngliche Mail ----- > Von: "schaecsn" > An: "richard" , "linux-mtd" , "linux-kernel" > > CC: "schaecsn" , "Stefan Schaeckeler" > Gesendet: Sonntag, 10. Oktober 2021 06:22:39 > Betreff: [PATCH v2] ubifs: ubifs to export filesystem error counters > Not all ubifs filesystem errors are propagated to userspace. > > Export bad magic, bad node and crc errors via sysfs. This allows userspace > to notice filesystem errors: > > /sys/fs/ubifs/ubiX_Y/errors_magic > /sys/fs/ubifs/ubiX_Y/errors_node > /sys/fs/ubifs/ubiX_Y/errors_crc > > The counters are reset to 0 with a remount. > > Signed-off-by: Stefan Schaeckeler > --- > Changes in v2: > - merged sysfs.h header into ubifs.h. > - io.c: wrapped incrementing error counters into new functions > record_*_error(). > - sysfs.c: removed sysfs write callback for clearing stats. > - sysfs.c: ubifs_sysfs_register(): free c->stats on error. > - sysfs.c: ubifs_attr_show(): use sysfs_emit(). > > fs/ubifs/Makefile | 2 +- > fs/ubifs/io.c | 21 +++++++ > fs/ubifs/super.c | 16 ++++- > fs/ubifs/sysfs.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++ > fs/ubifs/ubifs.h | 35 +++++++++++ > 5 files changed, 225 insertions(+), 2 deletions(-) > create mode 100644 fs/ubifs/sysfs.c Queued for 5.16. I just noticed forgot to request sysfs documentation in Documentation/ABI/. Can you please send a followup patch? Thanks, //richard