Skip to content

Commit

Permalink
fs/ntfs3: Create MFT zone only if length is large enough
Browse files Browse the repository at this point in the history
Also removed uninformative print

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
  • Loading branch information
Konstantin Komarov committed Aug 3, 2022
1 parent 9256ec3 commit 8039edb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/ntfs3/fsntfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,12 +806,6 @@ int ntfs_refresh_zone(struct ntfs_sb_info *sbi)

/* Try to allocate clusters after last MFT run. */
zlen = wnd_find(wnd, sbi->zone_max, lcn_s, 0, &lcn_s);
if (!zlen) {
ntfs_notice(sbi->sb, "MftZone: unavailable");
return 0;
}

/* Truncate too large zone. */
wnd_zone_set(wnd, lcn_s, zlen);

return 0;
Expand Down Expand Up @@ -2472,8 +2466,9 @@ void mark_as_free_ex(struct ntfs_sb_info *sbi, CLST lcn, CLST len, bool trim)
if (zlen == zone_len) {
/* MFT zone already has maximum size. */
} else if (!zone_len) {
/* Create MFT zone. */
wnd_zone_set(wnd, lcn, zlen);
/* Create MFT zone only if 'zlen' is large enough. */
if (zlen == sbi->zone_max)
wnd_zone_set(wnd, lcn, zlen);
} else {
CLST zone_lcn = wnd_zone_bit(wnd);

Expand Down

0 comments on commit 8039edb

Please sign in to comment.