exfat: fix erroneous discard when clear cluster bit
authorHyeongseok Kim <hyeongseok@gmail.com>
Thu, 4 Mar 2021 00:15:34 +0000 (09:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:36 +0000 (14:47 +0200)
commit11e3ff7e164a69b8807a9c1066c1b6adbb6033e1
treee171de1d1630bd50913de43b640ef7f365d9f436
parent1c525c265668176301bac4f152dd49a3c51c7ac6
exfat: fix erroneous discard when clear cluster bit

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>
fs/exfat/balloc.c