Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp987308pxb; Wed, 27 Oct 2021 16:48:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHIoOqGQEJnfdRjM2QeDwuWe1bS4wfR7ow664afUkRCSiEudo0I6dMGnq1mZ1BAZxRkxJ0 X-Received: by 2002:a17:906:5017:: with SMTP id s23mr859269ejj.546.1635378514583; Wed, 27 Oct 2021 16:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635378514; cv=none; d=google.com; s=arc-20160816; b=Vn79KvfFDSl+wjoVV9SI3/64JI9+KY7PHrP5as1SKgyoTbC33AknyCAfBiHIFr3674 9dy6IzjyoiAsD8a2FIP6GCMR8SSMvOK5ut78upPC3ALv5x8rPR1phS/C6sCgDxBDwXXT X1DdrJMl/RgYyYEOIyQNpMlmskzXUxAd0IuVQw2yWyBNCr7dgj86XpFf8uTl+OO/OMWI ECgdWDW0p1k7EKqoS8SiifbZFtwS2B2kTsyLsAntRRDvxV0evW3gLJnP3aFVsvsLgliN j3EEqpgQLa5647+3/7fCoBaH0kjtPObGWbX4YbQxcY3uAqD6vRMMhprk7CiXDH/h3fIw i8bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vg6E5OmGYHn5+IyE3WrLoYyvAdoqCM0a4q0JJegvWrM=; b=s2krSbcmLC10Ybt73taS7fbDigFLP321vqmaO96ZB0PP9nP3HtPS+QggBmXp3jp99n suabHF+HfUFAihXZpIkfqeA+1cfA+73heB1tcgSIdUMZOXVnAJ6aM6KvtkLxmAmkP92L c9UlT05L8o+/PiTpP5chkEA7zcEJePE77sXcLJJHC9294hYQDDN5iBghYx8ZMlBYTO/1 kDViPlbBEpDz7d/nlvBr1roR9wXp8ecSURf8sYfsPjgfLGiAyIq9XQAh0t+6cBkNwHm6 O3bRwPjeeInMzlSp379SPBhAs+cdhXtom3kTLBUIYpB7pF/uwlAuC1pwiqVAF8WFrbw5 /uSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HOcNND3N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lv19si1542479ejb.136.2021.10.27.16.48.09; Wed, 27 Oct 2021 16:48:34 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HOcNND3N; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbhJ0Xsn (ORCPT + 99 others); Wed, 27 Oct 2021 19:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229474AbhJ0Xsm (ORCPT ); Wed, 27 Oct 2021 19:48:42 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE52AC061570 for ; Wed, 27 Oct 2021 16:46:16 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so3317736pjb.0 for ; Wed, 27 Oct 2021 16:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vg6E5OmGYHn5+IyE3WrLoYyvAdoqCM0a4q0JJegvWrM=; b=HOcNND3NwAYdfC1iNgX23mLTtOXmPIeoXtLFFSOH8mSPtJPxBBFyvKWiHvpKsSy8We IwxkX99QGe6YVajOZUV4bNuLB280NVgc15b+Ai/mLg+LY1Iu+UlYz4TRoPEu+gLuf1TI RRbLh+nA93ctjQuxpPc9kUHRv7MkDqdFYfItF+1z1m6SBNtzKuEH6Gg8pOAlOynKCAkq OZJGWw5f6YoIlx9LmLTFRRDUB9DRIxnaC2ZRxuQsUrl7sHWxO0BsyjEZAPlTZw4tjhnk emvD7ZyM0HQgqSngwBM2to43ZkPGBfcP3rp3KS8Xe5DgqCnMh8RszzBDnohYhPgLAGnZ HXpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vg6E5OmGYHn5+IyE3WrLoYyvAdoqCM0a4q0JJegvWrM=; b=CCYpIeIFvlgDJ/obTIkg7HEX5FCqP7cSxOI/C8nBBmg60HMMR++ZqXhJl+QyeK1x1S JbGIDU0xL+owiHXYY6vQZcs/SHp56HOR94SNVVNKkbxNy5/y/hKN+9sT7qJI7qcF2fbF LPVZPjZX4TVdiGL6xcnnHJiZ6sfjvj8OpgYcUfZsWKvuchr23sedTAhG792+sKjM2d8W G85IIFPpiLWDwBtCihJMfam7m+pXfJhLcjWkly6+qESikLIGie8SWKzYaQOGL3YLZCRN /XTi/gMP31P9zcnaLsT1vkBFls2PLtYKdR9XBbeCcXQNvg59HBBtLZvjz288yTbq2167 YR9w== X-Gm-Message-State: AOAM531dcXwEIw5TVQWXWsmG8Y+7p+rZsiPXtrpi67PaVG1cXcIB02HG Uy9bgEdIwEH9XMbdo/Z0PjGgYm9gYrM= X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr9162564pjq.137.1635378375954; Wed, 27 Oct 2021 16:46:15 -0700 (PDT) Received: from daehojeong-desktop.mtv.corp.google.com ([2620:15c:211:201:b75c:b351:dcb7:11d8]) by smtp.gmail.com with ESMTPSA id b9sm1048168pfv.158.2021.10.27.16.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 16:46:15 -0700 (PDT) From: Daeho Jeong To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Daeho Jeong Subject: [PATCH 1/2] f2fs-tools: remove false failure alarm when fixing quota Date: Wed, 27 Oct 2021 16:46:10 -0700 Message-Id: <20211027234611.1958146-1-daeho43@gmail.com> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daeho Jeong Even though fsck fixed quota issues, fsck returns failure status and makes the user code misunderstand like errors are still there. Signed-off-by: Daeho Jeong --- fsck/fsck.c | 6 ++++-- include/f2fs_fs.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fsck/fsck.c b/fsck/fsck.c index 110c1ec..bc11e07 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -2025,7 +2025,7 @@ int fsck_chk_quota_files(struct f2fs_sb_info *sbi) f2fs_filesize_update(sbi, ino, 0); ret = quota_write_inode(sbi, qtype); if (!ret) { - c.bug_on = 1; + c.quota_fixed = true; DBG(1, "OK\n"); } else { ASSERT_MSG("Unable to write quota file"); @@ -2197,6 +2197,8 @@ void fsck_init(struct f2fs_sb_info *sbi) ASSERT(fsck->dentry != NULL); memcpy(fsck->dentry->name, "/", 1); fsck->dentry_end = fsck->dentry; + + c.quota_fixed = false; } static void fix_hard_links(struct f2fs_sb_info *sbi) @@ -3330,7 +3332,7 @@ int fsck_verify(struct f2fs_sb_info *sbi) if (force || (c.fix_on && f2fs_dev_is_writable())) { struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); - if (force || c.bug_on || c.bug_nat_bits) { + if (force || c.bug_on || c.bug_nat_bits || c.quota_fixed) { /* flush nats to write_nit_bits below */ flush_journal_entries(sbi); fix_hard_links(sbi); diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 69260a6..9f918ba 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -491,6 +491,7 @@ struct f2fs_configuration { int defset; int bug_on; int bug_nat_bits; + bool quota_fixed; int alloc_failed; int auto_fix; int layout; -- 2.33.0.1079.g6e70778dc9-goog