Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5248838rwi; Mon, 17 Oct 2022 18:11:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM415aD55bky2GZKpoqMQg14232dQMV9d0IWSbUmp0DVqrp9mWzxOTn00n7OerBsz/BRx8s/ X-Received: by 2002:a17:906:cc0f:b0:78e:1208:8796 with SMTP id ml15-20020a170906cc0f00b0078e12088796mr337264ejb.601.1666055484971; Mon, 17 Oct 2022 18:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666055484; cv=none; d=google.com; s=arc-20160816; b=YQJdQx7qHeLkAmUfaTnIhh/P5Ds7jwELm/YNjBL9E4bnEPBaDvZ2l11fPILb51S9YK l17bKhHHIsTET8N4KOvp1Ok00ZO4emF6PcgVs5lqyQnB2LdEpaJdMxWJaHXDco1bHhoe yZT43SmwWl5NrRfUBAwSnJTCn8ecu5tG9WuHN3aYFceVtVFT91n2ZXmnXNy7S5wRjxqZ dlNfTENtWUbq/Qe91F5sOwhxzvqE0GQWpyVKTg1FdPO0IzabZ1JclowEctd5rJhEMMOg XvyBb2SUuWH+IKMB412u9aIlcYgwDveHoIfx69qoFr7hN/zN0HWyK4J8Xww7wZKqnHPH Nsjw== 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=UHqNkRk4bPYgLLFvmZmG1eW5DjX+Z2iPUVmnW0Nqwb4=; b=Q8XNRMd4htoFjBEJHcPS70CT8UHCFN9k/OoERc9mpropZyoP2vnTiPsthW/0IBd2h3 OxIqpk+lNe0fTkh7EGQXvccsizTtq9zvRrj/ELw5bZ1Wg3cbbeg91sdgRXz0ODbBNo7S Vf7NX1wKtlExkOXroZhePZUHolx0kJKSDBNijXt5iDGdL180PKCml6IqcAVY4e58DjtL ogfkLydaXtaoTo0BCF6IO8bUUhiZUFT+bI+kfDWty1rPokHG2/VLSFLhHi4f//kJuC/c mqXgD3/mPbl/lt8pEsYhwwFQAhJzMfASLGav7FLbJuRM9uc4ZCvqywDbsDI5yEonzzIu 5d3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4vZwFiU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a50d5cb000000b00457c6b5dc07si9276781edj.455.2022.10.17.18.10.59; Mon, 17 Oct 2022 18:11:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4vZwFiU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230426AbiJRA6Q (ORCPT + 99 others); Mon, 17 Oct 2022 20:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbiJRA6O (ORCPT ); Mon, 17 Oct 2022 20:58:14 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D04B0193EC for ; Mon, 17 Oct 2022 17:58:13 -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 sin.source.kernel.org (Postfix) with ESMTPS id 0D21ACE180B for ; Tue, 18 Oct 2022 00:58:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40829C433C1; Tue, 18 Oct 2022 00:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666054690; bh=EQfYE38gG+3EcKKsQRkrz/TOt3/lj4TBQRUYoSHM1ZA=; h=From:To:Cc:Subject:Date:From; b=U4vZwFiUKpge2D1EXLJqUATIuJMvFM/JYBRI43lZBV2OCmEfZo1ZFd9L5rR/pdwGK oIhgrg4ykO93RQQoM09JiC6oMCo3r/uQY5RvYamimihg88BCNKegNfGEQ4RN3OfljW DQgnf0/Qy0kJdgSaZcljHtM312itonP2yMosfsdRHZR1hput9pIUW3LwKQif99cz9u 3R2UsdYg9Q1No7ymlZuSNYzBDFiCCE0fYHNTkB6trKZxUzFwiZYpzI09fyC2FJvHoP s4bKSEiL1WDk48Hkqa4TXjK9IGxHQctCuYSiSMfzuAxV5amG9cNafkF+Vc0H3Qy0BQ E6TsKKljkBYHQ== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: let's avoid to get cp_rwsem twice by f2fs_evict_inode by d_invalidate Date: Mon, 17 Oct 2022 17:58:06 -0700 Message-Id: <20221018005806.892778-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 f2fs_unlink -> f2fs_lock_op -> d_invalidate -> shrink_dentry_list -> iput_final -> f2fs_evict_inode -> f2fs_lock_op Signed-off-by: Jaegeuk Kim --- fs/f2fs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index a389772fd212..e104409c3a0e 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -632,6 +632,8 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) goto fail; } f2fs_delete_entry(de, page, dir, inode); + f2fs_unlock_op(sbi); + #if IS_ENABLED(CONFIG_UNICODE) /* VFS negative dentries are incompatible with Encoding and * Case-insensitiveness. Eventually we'll want avoid @@ -642,8 +644,6 @@ static int f2fs_unlink(struct inode *dir, struct dentry *dentry) if (IS_CASEFOLDED(dir)) d_invalidate(dentry); #endif - f2fs_unlock_op(sbi); - if (IS_DIRSYNC(dir)) f2fs_sync_fs(sbi->sb, 1); fail: -- 2.38.0.413.g74048e4d9e-goog