Date: Fri, 9 Aug 2019 19:09:05 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350825 - head/stand/libsa/zfs Message-ID: <201908091909.x79J951p090297@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Fri Aug 9 19:09:05 2019 New Revision: 350825 URL: https://svnweb.freebsd.org/changeset/base/350825 Log: loader: add error check for vdev_indirect calls We can error out due to memory allocation errors, we can not recover from those and need to get out. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Fri Aug 9 12:15:23 2019 (r350824) +++ head/stand/libsa/zfs/zfsimpl.c Fri Aug 9 19:09:05 2019 (r350825) @@ -839,6 +839,7 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 { list_t stack; spa_t *spa = vd->spa; + zio_t *zio = arg; list_create(&stack, sizeof (remap_segment_t), offsetof(remap_segment_t, rs_node)); @@ -872,6 +873,13 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 dst_offset + inner_offset, inner_size, arg); + /* + * vdev_indirect_gather_splits can have memory + * allocation error, we can not recover from it. + */ + if (zio->io_error != 0) + break; + rs->rs_offset += inner_size; rs->rs_asize -= inner_size; rs->rs_split_offset += inner_size; @@ -879,6 +887,8 @@ vdev_indirect_remap(vdev_t *vd, uint64_t offset, uint6 free(mapping); free(rs); + if (zio->io_error != 0) + break; } list_destroy(&stack); @@ -935,6 +945,8 @@ vdev_indirect_read(vdev_t *vdev, const blkptr_t *bp, v } vdev_indirect_remap(vdev, offset, bytes, &zio); + if (zio.io_error != 0) + return (zio.io_error); first = list_head(&iv->iv_splits); if (first->is_size == zio.io_size) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908091909.x79J951p090297>