On 7/10/20 9:06 AM, Josef Bacik wrote:
> Eric reported seeing this message while running generic/475
>
> BTRFS: error (device dm-3) in btrfs_sync_log:3084: errno=-117 Filesystem corrupted
>
> This ret came from btrfs_write_marked_extents(). If we get an aborted
> transaction via an -EIO somewhere, we'll see it in
> btree_write_cache_pages() and return -EUCLEAN, which we spit out as
> "Filesystem corrupted". Except we shouldn't be returning -EUCLEAN here,
> we need to be returning -EIO. -EUCLEAN is reserved for actual
> corruption, not IO errors.
Is BTRFS_FS_STATE_ERROR only set for IO errors, or could it also be
set for an actual corruption state?
> Reported-by: Eric Sandeen <esandeen@xxxxxxxxxx>
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> ---
> fs/btrfs/extent_io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index a76b7da91aa6..6f0dd15729cc 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -4122,7 +4122,7 @@ int btree_write_cache_pages(struct address_space *mapping,
> if (!test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
> ret = flush_write_bio(&epd);
> } else {
> - ret = -EUCLEAN;
> + ret = -EIO;
> end_write_bio(&epd, ret);
> }
> return ret;
>