From e8ccdbc8af07d2c81008ad7be50efee31b0c2f7a Mon Sep 17 00:00:00 2001 From: Paul Dagnelie Date: Wed, 6 Oct 2021 10:13:51 -0700 Subject: [PATCH] Fix error handling in IO case during pool open failure (#492) Signed-off-by: Paul Dagnelie --- include/sys/vdev_object_store.h | 1 + module/os/linux/zfs/vdev_object_store.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sys/vdev_object_store.h b/include/sys/vdev_object_store.h index ee6e4d78ea50..4695afdf312d 100644 --- a/include/sys/vdev_object_store.h +++ b/include/sys/vdev_object_store.h @@ -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; diff --git a/module/os/linux/zfs/vdev_object_store.c b/module/os/linux/zfs/vdev_object_store.c index 9ddf423f0ed3..0a9ff146953b 100644 --- a/module/os/linux/zfs/vdev_object_store.c +++ b/module/os/linux/zfs/vdev_object_store.c @@ -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);