Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4450403rdb; Fri, 29 Dec 2023 02:06:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH7E6Erl44knKVAVjgkfStByPMNoZ+1YwTIPUkgmF63UlIMgRPaoAaN0ADXhTgQ8HUjJ2uK X-Received: by 2002:a05:6a20:4293:b0:196:8679:4c2b with SMTP id o19-20020a056a20429300b0019686794c2bmr259450pzj.112.1703844375605; Fri, 29 Dec 2023 02:06:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703844375; cv=none; d=google.com; s=arc-20160816; b=fL6AcTMw7l3wHgbUWg5gELxk1fH5w3rj1L9zhbVIw1tnHFr3/4eMLE1vj9VRNftfHW j8dUL2axlmxtVcstlxOe4+zREA0pAkN4sGxU9drTq/1U1VDG2aalvrsC1bKBXiJhpaOR B66dug2R//rxkH6fiiLEfbeKUNduvgdK2hLxuEfI4a488Bhskrv6KzYpwxFUQdQpSJQd QjvCXztZh3jHJ4nIRC2HXeWRzH437xhmf6VsT2qXPSED7mWxtibDw7W563JdIB2HkbI5 kPjLnjh5mbclDkw75luXRjVgmrpzR1F5WERW4ljLOFvRjzHD7cbPxUZkGhbgHb9j4V5O fDcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=thread-index:thread-topic:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject :references:in-reply-to:message-id:cc:to:from:date; bh=sunXK6CBEL+sOIPstwax6xLB28pvCHpv5e5gCmrIKA8=; fh=K5fi08nvyvjTHbs3fG9A/wz537YMGgjcx5VBWchWW8k=; b=WxpJVEliHXFkgcwiKT3ODJ3QBFZk0WAEMg0EsBDlPCWAYzqTl1qqbWmm/PRuRnn6os RQ9cuwzS0O76WbftPkmleX34V9dBz5onIgxHwtGohf8CIJizxjchhfy/PeDwvrre73TH L+eH8Oa/N3SkKHisyrpOW0oC8Pdztg7nYeeyCqNBGPRaBv++ZXs+RPW/aVCEIq4ChCYo pT8PLl1yQRIxfg533NKn7MlCAd3Wyes1SJ3bXeYhW4AUIxNTL8t8yqJ99WMaNJte+gKF mPjtVWmJSfAQ46tg39JaY3N6ujQjQOBlXWNeY1nx+yjHtUD4wpcg+h3pIKvPKEeQwG6g VTnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13041-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13041-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y4-20020a17090a8b0400b0028b7653ac36si17190267pjn.171.2023.12.29.02.06.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 02:06:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13041-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-13041-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13041-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 39352284872 for ; Fri, 29 Dec 2023 10:06:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37C5B10A22; Fri, 29 Dec 2023 10:06:10 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35E0110A09 for ; Fri, 29 Dec 2023 10:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nod.at Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nod.at Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id 8DB196343B36; Fri, 29 Dec 2023 11:06:03 +0100 (CET) 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 W5C9DOrgUFB0; Fri, 29 Dec 2023 11:06:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by lithops.sigma-star.at (Postfix) with ESMTP id B7F466343B3C; Fri, 29 Dec 2023 11:06:02 +0100 (CET) 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 W8mcbDZFkA7d; Fri, 29 Dec 2023 11:06:02 +0100 (CET) Received: from lithops.sigma-star.at (lithops.sigma-star.at [195.201.40.130]) by lithops.sigma-star.at (Postfix) with ESMTP id 8365E6343B36; Fri, 29 Dec 2023 11:06:02 +0100 (CET) Date: Fri, 29 Dec 2023 11:06:02 +0100 (CET) From: Richard Weinberger To: chengzhihao1 Cc: david oberhollenzer , Miquel Raynal , Sascha Hauer , Tudor Ambarus , linux-kernel , linux-mtd Message-ID: <1145531757.175508.1703844362355.JavaMail.zimbra@nod.at> In-Reply-To: <20231228014112.2836317-1-chengzhihao1@huawei.com> References: <20231228014112.2836317-1-chengzhihao1@huawei.com> Subject: Re: [PATCH RFC 00/17] ubifs: Add filesystem repair support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: Zimbra 8.8.12_GA_3807 (ZimbraWebClient - FF97 (Linux)/8.8.12_GA_3809) Thread-Topic: ubifs: Add filesystem repair support Thread-Index: dDGyRRcFTNJRSeVoML57/54HOrx0FA== ----- Urspr=C3=BCngliche Mail ----- > Von: "chengzhihao1" > An: "david oberhollenzer" , "richard" = , "Miquel Raynal" > , "Sascha Hauer" , "Tu= dor Ambarus" > CC: "linux-kernel" , "linux-mtd" > Gesendet: Donnerstag, 28. Dezember 2023 02:40:55 > Betreff: [PATCH RFC 00/17] ubifs: Add filesystem repair support Thanks a lot for sharing this. Below you find some thoughts that came into my mind while skimming over the patch series. > UBIFS repair provides a way to fix inconsistent UBIFS image(which is > corrupted by hardware exceptions or UBIFS realization bugs) and makes > filesystem become consistent, just like fsck tools(eg. fsck.ext4, > fsck.f2fs, fsck.fat, etc.) do. I don't fully agree. The tool makes UBIFS mount again but you still have lo= st data and later userspace might fail because file no longer contain what the appl= ication expected. So my fear is that we're just shifting the problem one layer up. UBIFS never had a fsck for reasons. UBIFS tries hard to not become inconsis= tent, by maintaining a data journal for example. It can fail of course by hardware issues. e.g. if the underlying MTD loses = bits, but there is nothing UBIFS can do except something like storing duplicates of data like BTRFS does. And finally, the biggest pain point, it can fail due to bugs in UBIFS itsel= f. In my opinion bugs should get addressed by improving our test infrastructur= e instead of working around. > About why do we need it, how it works, what it can fix or it can not > fix, when and how to use it, see more details in > Documentation/filesystems/ubifs/repair.rst (Patch 17). This needs to go into the cover letter. =20 > Testing on UBIFS repair refers to > https://bugzilla.kernel.org/show_bug.cgi?id=3D218327 >=20 > Whatever, we finally have a way to fix inconsistent UBFIS image instead > of formatting UBI when UBIFS becomes inconsistent. Fix in terms of making mount work again, I fear? As I said, most likely the problem is now one layer above. UBIFS thinks everything is good but userspace suddenly will see old/incomplete files. What I can think of is a tool (in userspace like other fscks) which can recover certain UBIFS structures but makes very clear to the user what the data is lost. e.g. that inode XY now misses some blocks or an old versi= on of something will be used. But this isl nothing you can run blindly in production. Thanks, //richard