diff options
author | mav <mav@FreeBSD.org> | 2014-11-03 03:45:41 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-11-03 03:45:41 +0000 |
commit | edabf036a27d8825db130cf97f70fadf9f0fbad9 (patch) | |
tree | 76487556f01dd4c3e7887f3b4ac671000f6096f3 /sys/cam/ctl/ctl_backend_block.c | |
parent | 131eff3491079fe85625cc77ef46a79f1b1f9962 (diff) | |
download | FreeBSD-src-edabf036a27d8825db130cf97f70fadf9f0fbad9.zip FreeBSD-src-edabf036a27d8825db130cf97f70fadf9f0fbad9.tar.gz |
MFC r273809:
Implement better handling for ENOSPC error for both CTL and CAM.
This makes VMWare VAAI Thin Provisioning Stun primitive activate, pausing
the virtual machine, when backing storage (ZFS pool) is getting overflowed.
Diffstat (limited to 'sys/cam/ctl/ctl_backend_block.c')
-rw-r--r-- | sys/cam/ctl/ctl_backend_block.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 9ea8b94..e6122a3 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -504,6 +504,8 @@ ctl_be_block_biodone(struct bio *bio) if (beio->num_errors > 0) { if (error == EOPNOTSUPP) { ctl_set_invalid_opcode(&io->scsiio); + } else if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, @@ -714,14 +716,12 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, char path_str[32]; ctl_scsi_path_string(io, path_str, sizeof(path_str)); - /* - * XXX KDM ZFS returns ENOSPC when the underlying - * filesystem fills up. What kind of SCSI error should we - * return for that? - */ printf("%s%s command returned errno %d\n", path_str, (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } @@ -807,7 +807,10 @@ ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, * return the I/O to the user. */ if (error != 0) { - ctl_set_medium_error(&io->scsiio); + if (error == ENOSPC) { + ctl_set_space_alloc_fail(&io->scsiio); + } else + ctl_set_medium_error(&io->scsiio); ctl_complete_beio(beio); return; } |