Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5619340pxb; Mon, 28 Mar 2022 15:03:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPccpMPmLs9d/+gKZuaV4gwBwdV3OFWs450QKjpj2eiAOL6uP5DzlKP4hWZIyBPiDBRV3z X-Received: by 2002:ac8:5842:0:b0:2e1:aa10:e7cd with SMTP id h2-20020ac85842000000b002e1aa10e7cdmr24451014qth.330.1648505032747; Mon, 28 Mar 2022 15:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648505032; cv=none; d=google.com; s=arc-20160816; b=B3BKZVXMfbDa9t4Uo8V7GSP9LccNEDwAmYlNG51at1Z68EWzSuAszWa6bX5zVPdJPd MI4NfplDJySmA2mfe11l47KA9JJXb1El6aGfaT5Q9CQ32mTX1sAcoYR+x51tT6BaxMny 66sdvv0KgcBJptYfcGVbAXkX50VfWw94ToI1uFJcagVgMaUdZ1yhcNonBK8CwZ2qVhTX lwoq0G+sLMkFeyvD9pTa52PL1qC7X2iJ84d2zK9Jg92pRTaymRcO8QcxT3Dq3kYMnnrM sivPt0WnKellYdm+UVgz4DxzKw8EeH208vYw9vyWZLQK/bCw4KSNGSVkH+7hzhnlu7xh j2vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=b/KJHCSTc/d/QUO1Pt9gdITAvyAV17id9dS6XuY5G1c=; b=BA/+D0aNZbR5pzlG54ye0NcEaneovWdqeZV3dh7wtBN6nSUxP4tIf9p2tfXw4+ScmQ 7IrvRm79Za969NuZriPiwKIWzX9KsxKNgWVCf/+yrKH2PF/EIa4dNnOEc4Fd5KMhl2XT Q0hBZF5Klxf2g/bdjXarF4h4cIJ7pFEhkY0lcfJEs58qKPHwkkVttslKPOroiDHiRuES C0S5KDw7MtPg8SfSDLV3IkcxzO49ARPJzWrig4cH4fEQCXMbhAXOjwcq4NGx8r01lKeO 9HZ/WNvBVvTaV1FeSASTrh5mGqQTEIfsoS5uFJHHE5bVuOEEeAzvRKcdPDk0Prxl0+Nk L/KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RwJQFZtG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l2-20020a056102050200b00324ec87b605si2986055vsa.559.2022.03.28.15.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RwJQFZtG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 EE85A814AA; Mon, 28 Mar 2022 14:27:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237342AbiC1Bp0 (ORCPT + 99 others); Sun, 27 Mar 2022 21:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234947AbiC1BpY (ORCPT ); Sun, 27 Mar 2022 21:45:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A16F249FAF; Sun, 27 Mar 2022 18:43:44 -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 ams.source.kernel.org (Postfix) with ESMTPS id F1B9DB80DD4; Mon, 28 Mar 2022 01:43:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EBD8C340EC; Mon, 28 Mar 2022 01:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648431821; bh=7A18LrQnBuUKW4eG9uehKdgAef2TXiymAn97vaYYyic=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=RwJQFZtGH6IYV4yBdK9/XqHpSEzYp/le7BtiOpKc3vPrkUK9HeDttmo/4Y9JcEMQ5 dxloLypelrGeHnpzkemfRKTsMcOdAS0RiJgtw4bvbhe3qDyhJA2Tm6pefQbQqppl9O Rg9gIconWvKH6OiCu1gzhBIixsAZXoJGZ/D+XJeQCWUV3xtxLKpLVpoGf90BGTdNdd IoPeU9PZ73IsZdje8BnM4rv7KpVITNwgT9DMiAdis0H6ikx9pC5hiVV6mXks4sOTlh 43/yux82YofBDp0QlhvTeLwf7RRj26TgSlTFlBtJqhkbGAO8hzZHkgeHwLg63vCg4u 1h5BjRnhpHIUQ== Received: by mail-wr1-f42.google.com with SMTP id t11so18295668wrm.5; Sun, 27 Mar 2022 18:43:41 -0700 (PDT) X-Gm-Message-State: AOAM53076yDSP6AEl6thQgaNWfpMCFVwEPg0xg7N+GDxQDpRM7fQyVTp AziQMW7DhbQ8PgcEDZBnA6ikdycF2VhIsn4r4gc= X-Received: by 2002:adf:908e:0:b0:1e7:bea7:3486 with SMTP id i14-20020adf908e000000b001e7bea73486mr19631349wri.401.1648431819935; Sun, 27 Mar 2022 18:43:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:2c1:0:0:0:0 with HTTP; Sun, 27 Mar 2022 18:43:39 -0700 (PDT) In-Reply-To: References: From: Namjae Jeon Date: Mon, 28 Mar 2022 10:43:39 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] exfat: fix referencing wrong parent directory information after renaming To: "Yuezhang.Mo@sony.com" Cc: "sj1557.seo@samsung.com" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "Andy.Wu@sony.com" , "Wataru.Aoyama@sony.com" , "Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.3 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 2022-03-25 18:42 GMT+09:00, Yuezhang.Mo@sony.com : Hi Yuezhang, > During renaming, the parent directory information maybe > updated. But the file/directory still references to the > old parent directory information. > > This bug will cause 2 problems. > > (1) The renamed file can not be written. > > [10768.175172] exFAT-fs (sda1): error, failed to bmap (inode : 7afd50e4 > iblock : 0, err : -5) > [10768.184285] exFAT-fs (sda1): Filesystem has been set read-only > ash: write error: Input/output error Could you please elaborate how to reproduce it ? Thanks. > > (2) Some dentries of the renamed file/directory are not set > to deleted after removing the file/directory. > > fixes: 5f2aa075070c ("exfat: add inode operations") > > Signed-off-by: Yuezhang Mo > Reviewed-by: Andy Wu > Reviewed-by: Aoyama Wataru > Reviewed-by: Daniel Palmer > --- > fs/exfat/namei.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c > index a02a04a993bf..e7adb6bfd9d5 100644 > --- a/fs/exfat/namei.c > +++ b/fs/exfat/namei.c > @@ -1080,6 +1080,7 @@ static int exfat_rename_file(struct inode *inode, > struct exfat_chain *p_dir, > > exfat_remove_entries(inode, p_dir, oldentry, 0, > num_old_entries); > + ei->dir = *p_dir; > ei->entry = newentry; > } else { > if (exfat_get_entry_type(epold) == TYPE_FILE) { > -- > 2.25.1 >