REQ_OP_FLUSH appears in the submission path processing but not in
the response path processing. Hence it takes the "default" case
which seems to be designed for REQ_OP_READ and REQ_OP_WRITE.
So add a REQ_OP_FLUSH case to the response path.

Signed-off-by: Douglas Gilbert <dgilb...@interlog.com>
---

Is it correct to treat REQ_OP_FLUSH like the other OPs that
may send but never return data (as in a READ's data-in)?

Should this be fixed separately in the mainline?

 drivers/scsi/sd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 05014054e357..9cf88392e994 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2007,6 +2007,7 @@ static int sd_done(struct scsi_cmnd *SCpnt)
                }
        } else {
                switch (req_op(req)) {
+               case REQ_OP_FLUSH:
                case REQ_OP_DISCARD:
                case REQ_OP_WRITE_ZEROES:
                case REQ_OP_WRITE_SAME:
-- 
2.17.1

Reply via email to