Skip to content

Commit 8ec0a4a

Browse files
fdmananakdave
authored andcommitted
btrfs: log message if extent item not found when running delayed extent op
When running a delayed extent operation, if we don't find the extent item in the extent tree we just return -EIO without any logged message. This indicates some bug or possibly a memory or fs corruption, so the return value should not be -EIO but -EUCLEAN instead, and since it's not expected to ever happen, print an informative error message so that if it happens we have some idea of what went wrong, where to look at. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d2f79e6 commit 8ec0a4a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/btrfs/extent-tree.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,10 @@ static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
16551655
goto again;
16561656
}
16571657
} else {
1658-
err = -EIO;
1658+
err = -EUCLEAN;
1659+
btrfs_err(fs_info,
1660+
"missing extent item for extent %llu num_bytes %llu level %d",
1661+
head->bytenr, head->num_bytes, extent_op->level);
16591662
goto out;
16601663
}
16611664
}

0 commit comments

Comments
 (0)