Skip to content

Commit 240246f

Browse files
Goldwyn Rodrigueskdave
authored andcommitted
btrfs: mark compressed range uptodate only if all bio succeed
In compression write endio sequence, the range which the compressed_bio writes is marked as uptodate if the last bio of the compressed (sub)bios is completed successfully. There could be previous bio which may have failed which is recorded in cb->errors. Set the writeback range as uptodate only if cb->errors is zero, as opposed to checking only the last bio's status. Backporting notes: in all versions up to 4.4 the last argument is always replaced by "!cb->errors". CC: [email protected] # 4.4+ Signed-off-by: Goldwyn Rodrigues <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent c7c3a6d commit 240246f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/compression.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static void end_compressed_bio_write(struct bio *bio)
352352
btrfs_record_physical_zoned(inode, cb->start, bio);
353353
btrfs_writepage_endio_finish_ordered(BTRFS_I(inode), NULL,
354354
cb->start, cb->start + cb->len - 1,
355-
bio->bi_status == BLK_STS_OK);
355+
!cb->errors);
356356

357357
end_compressed_writeback(inode, cb);
358358
/* note, our inode could be gone now */

0 commit comments

Comments
 (0)