Commit 8f9ff189 authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o

ext4: fix FITRIM in no journal mode

When using FITRIM ioctl on a file system without journal it will
only trim the block group once, no matter how many times you invoke
FITRIM ioctl and how many block you release from the block group.

It is because we only clear EXT4_GROUP_INFO_WAS_TRIMMED_BIT in journal
callback. Fix this by clearing the bit in no journal mode as well.
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reported-by: default avatarJorge Fábregas <jorge.fabregas@gmail.com>
parent 5ba052fe
...@@ -4794,8 +4794,8 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, ...@@ -4794,8 +4794,8 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
" group:%d block:%d count:%lu failed" " group:%d block:%d count:%lu failed"
" with %d", block_group, bit, count, " with %d", block_group, bit, count,
err); err);
} } else
EXT4_MB_GRP_CLEAR_TRIMMED(e4b.bd_info);
ext4_lock_group(sb, block_group); ext4_lock_group(sb, block_group);
mb_clear_bits(bitmap_bh->b_data, bit, count_clusters); mb_clear_bits(bitmap_bh->b_data, bit, count_clusters);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment