summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2014-07-29 07:40:14 +0000
committermav <mav@FreeBSD.org>2014-07-29 07:40:14 +0000
commite6ff5c766b530bfedc2891cc10f8551e1c45db9b (patch)
tree58356482e4aa780e80c6ae5d6f928360d9d00f86
parent2dfd8b7dad7fa05a1ffc164eeb14e3847bba8fd0 (diff)
downloadFreeBSD-src-e6ff5c766b530bfedc2891cc10f8551e1c45db9b.zip
FreeBSD-src-e6ff5c766b530bfedc2891cc10f8551e1c45db9b.tar.gz
MFC r269122:
Fix infinite loop, when doing WRITE SAME on file-backed LUN.
-rw-r--r--sys/cam/ctl/ctl_backend_block.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index 6676351..31bfd9b 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -725,10 +725,11 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun,
}
/*
- * If this is a write, we're all done.
+ * If this is a write or a verify, we're all done.
* If this is a read, we can now send the data to the user.
*/
- if (ARGS(io)->flags & (CTL_LLF_WRITE | CTL_LLF_VERIFY)) {
+ if ((beio->bio_cmd == BIO_WRITE) ||
+ (ARGS(io)->flags & CTL_LLF_VERIFY)) {
ctl_set_success(&io->scsiio);
ctl_complete_beio(beio);
} else {
OpenPOWER on IntegriCloud