Skip to content

Commit 6f80ed1

Browse files
fs/ntfs3: Correct ntfs_check_for_free_space
zlen in some cases was bigger than correct value. Signed-off-by: Konstantin Komarov <[email protected]>
1 parent 910013f commit 6f80ed1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ntfs3/fsntfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ bool ntfs_check_for_free_space(struct ntfs_sb_info *sbi, CLST clen, CLST mlen)
456456
wnd = &sbi->used.bitmap;
457457
down_read_nested(&wnd->rw_lock, BITMAP_MUTEX_CLUSTERS);
458458
free = wnd_zeroes(wnd);
459-
zlen = wnd_zone_len(wnd);
459+
zlen = min_t(size_t, NTFS_MIN_MFT_ZONE, wnd_zone_len(wnd));
460460
up_read(&wnd->rw_lock);
461461

462462
if (free < zlen + clen)

0 commit comments

Comments
 (0)