linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@kernel.org>
To: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>
Cc: "sj1557.seo@samsung.com" <sj1557.seo@samsung.com>,
	 "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"erichong@qnap.com" <erichong@qnap.com>,
	 "Andy.Wu@sony.com" <Andy.Wu@sony.com>,
	"Wataru.Aoyama@sony.com" <Wataru.Aoyama@sony.com>
Subject: Re: [PATCH v1] exfat: fix appending discontinuous clusters to empty file
Date: Sun, 18 Feb 2024 14:44:23 +0900	[thread overview]
Message-ID: <CAKYAXd8yvGvstGxej2nOXeH8ByU-jZWnJG521LTUzk10GX1k5Q@mail.gmail.com> (raw)
In-Reply-To: <PUZPR04MB63167444783A68A96C950E5981532@PUZPR04MB6316.apcprd04.prod.outlook.com>

2024-02-17 15:38 GMT+09:00, Yuezhang.Mo@sony.com <Yuezhang.Mo@sony.com>:
> Eric Hong found that when using ftruncate to expand an empty file,
> exfat_ent_set() will fail if discontinuous clusters are allocated.
> The reason is that the empty file does not have a cluster chain,
> but exfat_ent_set() attempts to append the newly allocated cluster
> to the cluster chain. In addition, exfat_find_last_cluster() only
> supports finding the last cluster in a non-empty file.
>
> So this commit adds a check whether the file is empty. If the file
> is empty, exfat_find_last_cluster() and exfat_ent_set() are no longer
> called as they do not need to be called.
>
> Fixes: f55c096f62f1 ("exfat: do not zero the extended part")
> Reported-by: Eric Hong <erichong@qnap.com>
> Closes: https://github.com/namjaejeon/linux-exfat-oot/issues/66
> Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Applied it to #dev.
Thanks for your patch.

      reply	other threads:[~2024-02-18  5:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17  6:38 [PATCH v1] exfat: fix appending discontinuous clusters to empty file Yuezhang.Mo
2024-02-18  5:44 ` Namjae Jeon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKYAXd8yvGvstGxej2nOXeH8ByU-jZWnJG521LTUzk10GX1k5Q@mail.gmail.com \
    --to=linkinjeon@kernel.org \
    --cc=Andy.Wu@sony.com \
    --cc=Wataru.Aoyama@sony.com \
    --cc=Yuezhang.Mo@sony.com \
    --cc=erichong@qnap.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).