From 94d701bdfa110bd1c05c96c862a7ea36a9ee0871 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 30 Aug 2010 12:06:54 +0000 Subject: [PATCH] Let's do it in a more safe way git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2021 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 31d2414b5..eb3c8268e 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -2569,7 +2569,7 @@ static void blockio_endio(struct bio *bio, int error) /* To protect from several bios finishing simultaneously */ spin_lock_bh(&blockio_endio_lock); - if (bio->bi_rw & WRITE) + if (bio->bi_rw & (1 << BIO_RW)) scst_set_cmd_error(blockio_work->cmd, SCST_LOAD_SENSE(scst_sense_write_error)); else @@ -2708,7 +2708,7 @@ static void blockio_exec_rw(struct scst_cmd *cmd, struct scst_vdisk_thr *thr, bio = hbio; hbio = hbio->bi_next; bio->bi_next = NULL; - submit_bio(write, bio); + submit_bio((write != 0), bio); } if (q && q->unplug_fn)