diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-10-13 17:04:00 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-10-30 23:14:30 +0100 |
| commit | b5af0db0ede2b3897a4313f2f5a4baa1476708c1 (patch) | |
| tree | 54a6f3630f853dba08e1c3683f1b079c0ef07551 /scripts/dummy-tools/python3 | |
| parent | 6ad5b356020db4d096af29a0b461e789a4fa9fcc (diff) | |
btrfs: defrag: prevent inode truncated to zero from not being defragged again
If we add an inode to autodefrag and the inode is truncated to an i_size
of zero before it's picked by autodefrag (run by the cleaner kthread),
we exit btrfs_run_defrag_inode() leaving the BTRFS_INODE_IN_DEFRAG flag
set in the inode, which prevents the inode from being auto defragged in
the future until it's evicted, loaded again and small writes happen to
it again.
Fix this by clearing BTRFS_INODE_IN_DEFRAG before we check if the current
offset is at or beyond the inode's i_size.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/dummy-tools/python3')
0 files changed, 0 insertions, 0 deletions
