Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7097035rdb; Wed, 3 Jan 2024 04:45:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDfdTbeXW15HNyQbdzGFfSr0lP2lg9f/VZ+Icl6mFEgHousOZr/eFZcxTMsHouGGtfCfHv X-Received: by 2002:a9d:4b16:0:b0:6dc:54:f52a with SMTP id q22-20020a9d4b16000000b006dc0054f52amr10806597otf.4.1704285909876; Wed, 03 Jan 2024 04:45:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704285909; cv=none; d=google.com; s=arc-20160816; b=Nbv3uQehRCuw+vuk3lq0jGRKuAlvl2Fj58LQlcwE9hPe3kcbsePFgnPWFXYOuyLGOS tgJlccpB2qxFcbnoTakVFSFZC7UwzLj4r2VIwwfWEp7nEp+tF1+4CNP8GED0G1qxp/gK Ee/qhzECgIqh0xonUGAZi8jMazwfCc6F4BPmzIaJT05LD9QP6Nz62wHHQ9Xt2sLz5afs mXZScpCoG+7oszB19PahEAjggIJcLmEYL2gPNmk6cxcka8spU22zpSb8FLz3aib7tvU1 /Ol1AbEbMnu2xIy6UWMQ3jPc/yVGgF9TKXx/YGkjvTnupKjKAsusENRdI5TZa6Bt/CHp MSeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id :references:cc:to:from:subject; bh=OwvQecMJ86/pHjolKkXKAoS39gaW3WWWE1x5DJdHtB4=; fh=7vfNIKc+0t0VMx977PgdEnqNyG5N8YJqSkNJCpByyjg=; b=IEHzCuZK7Y1vJOlGzgz9DtlJfllj3TI1f3kySQS6pAkOtNOu7hUwjUDXG6xa1AeFrn tSLZlg6nRwiSF/XaciJCF6ylO8MEcMSD/9+xnHS+hxPEMTKb+/iJsnsTsU2eQLaR42cg 1PJKJD5kF5OMN0GHHUsje3I37Jl1/BaLMXHNvLar6Sx/PGih2mZ4aA03hP7f7155ZMx1 afnIVQ8c0o/NKN30oIEwYGGvmkz95JQmgisYUmc+Mjmi+6h92fpFE4quNJ4E05r28pDI 9lBHxHMwJzEvdsp6prAEMt8Xd5GU/Me4OwXFwAztkbN4I5ngDAQWyAouFk0HKM1OtKh8 7Ruw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15526-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b187-20020a62cfc4000000b006d9aab9520asi17414138pfg.65.2024.01.03.04.45.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 04:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-15526-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-15526-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-15526-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id A74F1B233E7 for ; Wed, 3 Jan 2024 12:44:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE412199A9; Wed, 3 Jan 2024 12:44:11 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (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 641BE19440 for ; Wed, 3 Jan 2024 12:44:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4T4qCT52zrzZfPt; Wed, 3 Jan 2024 20:43:49 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 39F7D180076; Wed, 3 Jan 2024 20:44:03 +0800 (CST) Received: from [10.174.178.46] (10.174.178.46) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 3 Jan 2024 20:44:02 +0800 Subject: Re: [PATCH RFC 00/17] ubifs: Add filesystem repair support From: Zhihao Cheng To: Richard Weinberger CC: david oberhollenzer , Miquel Raynal , Sascha Hauer , Tudor Ambarus , linux-kernel , linux-mtd References: <20231228014112.2836317-1-chengzhihao1@huawei.com> <1145531757.175508.1703844362355.JavaMail.zimbra@nod.at> <13b259ca-b32f-a8d6-5e11-8bb38df72f5c@huawei.com> <642239519.177270.1703884138999.JavaMail.zimbra@nod.at> <535616666.192239.1704228332389.JavaMail.zimbra@nod.at> <460eb02e-8937-282c-62c5-6ea606324b0e@huawei.com> Message-ID: Date: Wed, 3 Jan 2024 20:44:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <460eb02e-8937-282c-62c5-6ea606324b0e@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600013.china.huawei.com (7.193.23.68) 在 2024/1/3 11:18, Zhihao Cheng 写道: > 在 2024/1/3 4:45, Richard Weinberger 写道: >> ----- Ursprüngliche Mail ----- >>> Von: "chengzhihao1" >>> I come up with another way to implement fsck.ubifs: >>> >>> There are three modes: >>> >>> 1. common mode(no options): Ask user whether to fix as long as a problem >>> is detected. >> >> Makes sense. >> >>> 2. safe mode(-a option): Auto repair as long as no data/files lost(eg. >>> nlink, isize, xattr_cnt, which can be corrected without dropping nodes), >>> otherwise returns error code. >> >> Makes sense. >>> 3. dangerous mode(-y option): Fix is always successful, unless >>> superblock is corrupted. There are 2 situations: >> >> Please not use "-y". Usually "-y" stands for "answer yes to all >> questions". >> But selecting names for command line flags is currently my least concern. >>>    a) TNC is valid: fsck will print which file is dropped and which >>> file's data is dropped >> >> Sounds also good. >>>    b) TNC is invalid: fsck will scan all nodes without referencing TNC, >>> same as this patchset does >> >> I'd make this a distinct mode. >> It can be used to rebuild index and LEB property trees. >> This is basically a "drop trees and rebuild" mode. >> > > OK, then fsck will have four modes. How about merging 3(a) and 3(b) as one mode(dangerous mode)? If fsck can get a good TNC(all non-leaf index nodes are valid), fsck executes as 3(a) describes. If fsck cannot find a good TNC, fsck executes as 3(b) and reminds user that "TNC is damaged, nodes dropping is not awared".