Handle EDQUOT backend storage errors same as ENOSPC.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2015-05-06 19:47:31 +00:00
parent 79f1cdb4fb
commit 0631de4a79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282565

View file

@ -521,7 +521,7 @@ ctl_be_block_biodone(struct bio *bio)
if (beio->num_errors > 0) { if (beio->num_errors > 0) {
if (error == EOPNOTSUPP) { if (error == EOPNOTSUPP) {
ctl_set_invalid_opcode(&io->scsiio); ctl_set_invalid_opcode(&io->scsiio);
} else if (error == ENOSPC) { } else if (error == ENOSPC || error == EDQUOT) {
ctl_set_space_alloc_fail(&io->scsiio); ctl_set_space_alloc_fail(&io->scsiio);
} else if (beio->bio_cmd == BIO_FLUSH) { } else if (beio->bio_cmd == BIO_FLUSH) {
/* XXX KDM is there is a better error here? */ /* XXX KDM is there is a better error here? */
@ -738,7 +738,7 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun,
ctl_scsi_path_string(io, path_str, sizeof(path_str)); ctl_scsi_path_string(io, path_str, sizeof(path_str));
printf("%s%s command returned errno %d\n", path_str, printf("%s%s command returned errno %d\n", path_str,
(beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error); (beio->bio_cmd == BIO_READ) ? "READ" : "WRITE", error);
if (error == ENOSPC) { if (error == ENOSPC || error == EDQUOT) {
ctl_set_space_alloc_fail(&io->scsiio); ctl_set_space_alloc_fail(&io->scsiio);
} else } else
ctl_set_medium_error(&io->scsiio); ctl_set_medium_error(&io->scsiio);
@ -895,7 +895,7 @@ ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun,
* return the I/O to the user. * return the I/O to the user.
*/ */
if (error != 0) { if (error != 0) {
if (error == ENOSPC) { if (error == ENOSPC || error == EDQUOT) {
ctl_set_space_alloc_fail(&io->scsiio); ctl_set_space_alloc_fail(&io->scsiio);
} else } else
ctl_set_medium_error(&io->scsiio); ctl_set_medium_error(&io->scsiio);