summaryrefslogtreecommitdiff
path: root/Documentation/networking
diff options
context:
space:
mode:
authorYuezhang Mo <Yuezhang.Mo@sony.com>2024-02-16 15:19:55 +0300
committerNamjae Jeon <linkinjeon@kernel.org>2024-02-18 08:41:18 +0300
commit3a7845041eb7235f2fb00ef0960995da5be63b11 (patch)
tree7bf4953fad0f8f1ac6362ab222592a123d3a5033 /Documentation/networking
parentc02197fc9076e7d991c8f6adc11759c5ba52ddc6 (diff)
downloadlinux-3a7845041eb7235f2fb00ef0960995da5be63b11.tar.xz
exfat: fix appending discontinuous clusters to empty file
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> Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'Documentation/networking')
0 files changed, 0 insertions, 0 deletions