Hello I found that after defrag a file, the corresponding inode's i_blocks become incorrect. I hope following description address the real reason. i_blocks is decreased in 'btrfs_drop_extents' when something are drop/truncated and 'run_delalloc_range' calls 'btrfs_drop_extents' at first place, so 'run_delalloc_range' may decrease the i_blocks. ('btrfs_drop_extents' doesn't increase i_blocks). In normal write operation, i_blocks is increased in advance in 'dirty_and_release_pages', then decreased in 'run_delalloc_range' , so final result is correct. But when do file defrag or mmap write, i_blocks is only decreased by 'run_delalloc_range', i_blocks may underflow quickly. Regards YZ