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
This commit is contained in:
Vladislav Bolkhovitin
2010-08-30 12:06:54 +00:00
parent 83945bde9c
commit 94d701bdfa

View File

@@ -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)