Re: [PATCH v1] exfat: fix appending discontinuous clusters to empty file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2024-02-17 15:38 GMT+09:00, Yuezhang.Mo@xxxxxxxx <Yuezhang.Mo@xxxxxxxx>:
> 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@xxxxxxxx>
> Closes: https://github.com/namjaejeon/linux-exfat-oot/issues/66
> Signed-off-by: Yuezhang Mo <Yuezhang.Mo@xxxxxxxx>
Applied it to #dev.
Thanks for your patch.




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux