]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
exfat: fix erroneous discard when clear cluster bit
authorHyeongseok Kim <hyeongseok@gmail.com>
Thu, 4 Mar 2021 00:15:34 +0000 (09:15 +0900)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:32:24 +0000 (10:32 +0200)
commitfe7ac708c395ba5ee642407edb0f4f4bbc006290
treeae608c020f7b4a70fac5e0425ce3d82008da0926
parent3f1bc5432eb85fb5f04feafdf31fb57b22613ce8
exfat: fix erroneous discard when clear cluster bit

BugLink: https://bugs.launchpad.net/bugs/1928857
commit 77edfc6e51055b61cae2f54c8e6c3bb7c762e4fe upstream.

If mounted with discard option, exFAT issues discard command when clear
cluster bit to remove file. But the input parameter of cluster-to-sector
calculation is abnormally added by reserved cluster size which is 2,
leading to discard unrelated sectors included in target+2 cluster.
With fixing this, remove the wrong comments in set/clear/find bitmap
functions.

Fixes: 1e49a94cf707 ("exfat: add bitmap operations")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
Acked-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/exfat/balloc.c