Skip to content

Commit

Permalink
Fix error handling in IO case during pool open failure (openzfs#492)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dagnelie <[email protected]>
  • Loading branch information
pcd1193182 authored Oct 6, 2021
1 parent 401276f commit e8ccdbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/sys/vdev_object_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#define AGENT_TOTAL_DATA_OBJECTS "total_data_objects"
#define AGENT_DESTROYED_OBJECTS "destroyed_objects"
#define AGENT_POOLS "pools"
#define AGENT_MESSAGE "message"

typedef struct vdev_object_store_stats {
uint64_t voss_blocks_count;
Expand Down
5 changes: 4 additions & 1 deletion module/os/linux/zfs/vdev_object_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,8 +1111,11 @@ agent_reader(void *arg)
mutex_enter(&vos->vos_outstanding_lock);
vos->vos_result = SET_ERROR(EREMOTEIO);
} else if (strcmp(cause, "IO") == 0) {
char *message = fnvlist_lookup_string(nv,
AGENT_MESSAGE);
zfs_dbgmsg("message=\"%s\"", message);
mutex_enter(&vos->vos_outstanding_lock);
if (strstr(cause, "does not exist") != NULL) {
if (strstr(message, "does not exist") != NULL) {
vos->vos_result = SET_ERROR(ENOENT);
} else {
vos->vos_result = SET_ERROR(EIO);
Expand Down

0 comments on commit e8ccdbc

Please sign in to comment.