mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
Btrfs: fix compressed write corruption on enospc
When failing to allocate space for the whole compressed extent, we'll fallback to uncompressed IO, but we've forgotten to redirty the pages which belong to this compressed extent, and these 'clean' pages will simply skip 'submit' part and go to endio directly, at last we got data corruption as we write nothing. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Tested-By: Martin Steigerwald <martin@lichtvoll.de> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
f90e579c2b
commit
ce62003f69
1 changed files with 12 additions and 0 deletions
|
@ -709,6 +709,18 @@ retry:
|
|||
unlock_extent(io_tree, async_extent->start,
|
||||
async_extent->start +
|
||||
async_extent->ram_size - 1);
|
||||
|
||||
/*
|
||||
* we need to redirty the pages if we decide to
|
||||
* fallback to uncompressed IO, otherwise we
|
||||
* will not submit these pages down to lower
|
||||
* layers.
|
||||
*/
|
||||
extent_range_redirty_for_io(inode,
|
||||
async_extent->start,
|
||||
async_extent->start +
|
||||
async_extent->ram_size - 1);
|
||||
|
||||
goto retry;
|
||||
}
|
||||
goto out_free;
|
||||
|
|
Loading…
Add table
Reference in a new issue