Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4732411iob; Sun, 8 May 2022 23:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpJfhj9d1z8+CclHgaXfX8wdVhHwnNnxduseNbgTVf9l5TxMWUuRTVhgjcELrPHW8lgDQf X-Received: by 2002:a63:5564:0:b0:3ab:9d95:7a21 with SMTP id f36-20020a635564000000b003ab9d957a21mr12208512pgm.542.1652078189100; Sun, 08 May 2022 23:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652078189; cv=none; d=google.com; s=arc-20160816; b=vd7Q7cXL1FztmVu5CpNCK6udsJZKc4qn8rSc79BQheONP3y8ZqeSUqieJhr7bXgrLW gvVsCYlO3541WW+QemLVPHsXVjnhZiXSdAHBYqimHIXeE43L2ORXsP5Sd7nydKPxqXAM LfspkYqMS9Vq1oIrSyCPxNXES5nKzjmNpXIxZ+VU7Bb4orNeX4cws9QTT4lVbmfTuoBH ZVdo9fZkx68LoAvL8cUyJ7tpcF4XfcFLP8sKiczrPm3QpZP4GOthY39Sq7lZki2j1bmw PyhMW0ZkTSgenULeVimdEX7duI4UWdQeNUb5xwYVNmjekO8Wd2bb6GdjdDfIleE2Q2K0 M18Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QMwClOt53NT5HiqmGgjAygLMhnPG/2dnPVd76vGL7Gk=; b=Q+oc62YW1Obnp3FP7CG32fjTeqCC/yelC0/IhEP93+TRUD9LQH8me+XfkN818xAzPH w0EGVm4oR+I2EHxLlFGoyk6dN1xtLovlUMpmPgB4kEt57M3Y7uV8so5dbUZLeSNs99ys /u8JyEhnsLzsj8W4ZD4DllkC7TqqUFmrOBa8lq0TcbWeqj1TsF2If0ATMEPICl2GKnIx 8BQ3d2ZuAHs1drS7bxeaaeemgBnuGMp44fSjhqd0AHfHoUa/a2lJKsk4X12JJK3uPdwO yMf13+PR5q0szo5O+NQyVHc2pBMzdlvfsO3g3tmqm7T7mwYcgfPFPN3TtdFNhmZyVnUZ lQmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oNo2tIOd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c23-20020aa78c17000000b0050d4107ece5si12073284pfd.168.2022.05.08.23.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 23:36:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oNo2tIOd; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 38F2713C09D; Sun, 8 May 2022 23:31:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444985AbiEFXYh (ORCPT + 99 others); Fri, 6 May 2022 19:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355793AbiEFXYY (ORCPT ); Fri, 6 May 2022 19:24:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E34A746678; Fri, 6 May 2022 16:20:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6BC6261A47; Fri, 6 May 2022 23:20:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C81A3C385A8; Fri, 6 May 2022 23:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651879237; bh=paOGZ646ofsXxf6LRNQ+Cx4XSEFlOn+NkTo10rbSuNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oNo2tIOdBhU/9g8+h80Zq5s9KEShdKn5Bl9IMIK9qsIT9dHOeLSb/TlDPm7wjBjIA QltafoQTL7yEUnlwSvg7AMnMwchRTiM9PSUFFaC+cls1dHpKOxUdvTHsX/BfKPYtUk ze4jmsp3wD03cIRtlRF1nTmzuE4KawT1LeYm0xgkqt9so7A9rTT9CPB9pAL7hmAujp nmbY+xEZzBQbY8MSENhlHeFdHXA4V8/MjvWhkFCqJITsfbhJL/tbgpDllGqz8NVO6Y L7wsE4rj4zNn1YY4gd75pvxg2KQqZ9eJc6DW+rp8kxjq9UTAYPhCCLv6LSHbesHckr R0xtRPnc6abxA== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim , stable@vger.kernel.org Subject: [PATCH 5/5] f2fs: don't need inode lock for system hidden quota Date: Fri, 6 May 2022 16:20:32 -0700 Message-Id: <20220506232032.1264078-5-jaegeuk@kernel.org> X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog In-Reply-To: <20220506232032.1264078-1-jaegeuk@kernel.org> References: <20220506232032.1264078-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's avoid false-alarmed lockdep warning. [ 58.914674] [T1501146] -> #2 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}: [ 58.915975] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.916738] [T1501146] system_server: f2fs_quota_sync+0x60/0x1a8 [ 58.917563] [T1501146] system_server: block_operations+0x16c/0x43c [ 58.918410] [T1501146] system_server: f2fs_write_checkpoint+0x114/0x318 [ 58.919312] [T1501146] system_server: f2fs_issue_checkpoint+0x178/0x21c [ 58.920214] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.920999] [T1501146] system_server: f2fs_do_sync_file+0x334/0x738 [ 58.921862] [T1501146] system_server: f2fs_sync_file+0x30/0x48 [ 58.922667] [T1501146] system_server: __arm64_sys_fsync+0x84/0xf8 [ 58.923506] [T1501146] system_server: el0_svc_common.llvm.12821150825140585682+0xd8/0x20c [ 58.924604] [T1501146] system_server: do_el0_svc+0x28/0xa0 [ 58.925366] [T1501146] system_server: el0_svc+0x24/0x38 [ 58.926094] [T1501146] system_server: el0_sync_handler+0x88/0xec [ 58.926920] [T1501146] system_server: el0_sync+0x1b4/0x1c0 [ 58.927681] [T1501146] -> #1 (&sbi->cp_global_sem){+.+.}-{3:3}: [ 58.928889] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.929650] [T1501146] system_server: f2fs_write_checkpoint+0xbc/0x318 [ 58.930541] [T1501146] system_server: f2fs_issue_checkpoint+0x178/0x21c [ 58.931443] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.932226] [T1501146] system_server: sync_filesystem+0xac/0x130 [ 58.933053] [T1501146] system_server: generic_shutdown_super+0x38/0x150 [ 58.933958] [T1501146] system_server: kill_block_super+0x24/0x58 [ 58.934791] [T1501146] system_server: kill_f2fs_super+0xcc/0x124 [ 58.935618] [T1501146] system_server: deactivate_locked_super+0x90/0x120 [ 58.936529] [T1501146] system_server: deactivate_super+0x74/0xac [ 58.937356] [T1501146] system_server: cleanup_mnt+0x128/0x168 [ 58.938150] [T1501146] system_server: __cleanup_mnt+0x18/0x28 [ 58.938944] [T1501146] system_server: task_work_run+0xb8/0x14c [ 58.939749] [T1501146] system_server: do_notify_resume+0x114/0x1e8 [ 58.940595] [T1501146] system_server: work_pending+0xc/0x5f0 [ 58.941375] [T1501146] -> #0 (&sbi->gc_lock){+.+.}-{3:3}: [ 58.942519] [T1501146] system_server: __lock_acquire+0x1270/0x2868 [ 58.943366] [T1501146] system_server: lock_acquire+0x114/0x294 [ 58.944169] [T1501146] system_server: down_write+0x7c/0xe0 [ 58.944930] [T1501146] system_server: f2fs_issue_checkpoint+0x13c/0x21c [ 58.945831] [T1501146] system_server: f2fs_sync_fs+0x48/0x6c [ 58.946614] [T1501146] system_server: f2fs_do_sync_file+0x334/0x738 [ 58.947472] [T1501146] system_server: f2fs_ioc_commit_atomic_write+0xc8/0x14c [ 58.948439] [T1501146] system_server: __f2fs_ioctl+0x674/0x154c [ 58.949253] [T1501146] system_server: f2fs_ioctl+0x54/0x88 [ 58.950018] [T1501146] system_server: __arm64_sys_ioctl+0xa8/0x110 [ 58.950865] [T1501146] system_server: el0_svc_common.llvm.12821150825140585682+0xd8/0x20c [ 58.951965] [T1501146] system_server: do_el0_svc+0x28/0xa0 [ 58.952727] [T1501146] system_server: el0_svc+0x24/0x38 [ 58.953454] [T1501146] system_server: el0_sync_handler+0x88/0xec [ 58.954279] [T1501146] system_server: el0_sync+0x1b4/0x1c0 Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim --- fs/f2fs/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 5d5b35067c3d..09435280d856 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2700,7 +2700,8 @@ int f2fs_quota_sync(struct super_block *sb, int type) if (!sb_has_quota_active(sb, cnt)) continue; - inode_lock(dqopt->files[cnt]); + if (!f2fs_sb_has_quota_ino(sbi)) + inode_lock(dqopt->files[cnt]); /* * do_quotactl @@ -2719,7 +2720,8 @@ int f2fs_quota_sync(struct super_block *sb, int type) f2fs_up_read(&sbi->quota_sem); f2fs_unlock_op(sbi); - inode_unlock(dqopt->files[cnt]); + if (!f2fs_sb_has_quota_ino(sbi)) + inode_unlock(dqopt->files[cnt]); if (ret) break; -- 2.36.0.512.ge40c2bad7a-goog