aboutsummaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorKonstantin Komarov2022-10-07 20:23:19 +0300
committerKonstantin Komarov2022-11-14 19:50:46 +0300
commit6f80ed14d76c730f7943777ba259cd32870e6433 (patch)
tree88b8def9d7decf2e85ebd964aa04a4370506e2aa /fs/ntfs3
parent910013f7c7ba9fb82ce33536c58212907ca05969 (diff)
fs/ntfs3: Correct ntfs_check_for_free_space
zlen in some cases was bigger than correct value. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-rw-r--r--fs/ntfs3/fsntfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c
index 4f04e8594a8f..6a1e000fd2b5 100644
--- a/fs/ntfs3/fsntfs.c
+++ b/fs/ntfs3/fsntfs.c
@@ -456,7 +456,7 @@ bool ntfs_check_for_free_space(struct ntfs_sb_info *sbi, CLST clen, CLST mlen)
wnd = &sbi->used.bitmap;
down_read_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS);
free = wnd_zeroes(wnd);
- zlen = wnd_zone_len(wnd);
+ zlen = min_t(size_t, NTFS_MIN_MFT_ZONE, wnd_zone_len(wnd));
up_read(&wnd->rw_lock);
if (free < zlen + clen)