null_blk: fix checking for REQ_FUA
authorHeinz Mauelshagen <heinzm@redhat.com>
Fri, 22 Feb 2019 19:00:01 +0000 (20:00 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Feb 2019 21:03:03 +0000 (14:03 -0700)
null_handle_bio() erroneously uses the bio_op macro
which masks respective request flag bits including REQ_FUA
out thus failing the check.

Fix by checking bio->bi_opf directly.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk_main.c

index 83c38a6..417a9f1 100644 (file)
@@ -1104,7 +1104,7 @@ static int null_handle_bio(struct nullb_cmd *cmd)
                len = bvec.bv_len;
                err = null_transfer(nullb, bvec.bv_page, len, bvec.bv_offset,
                                     op_is_write(bio_op(bio)), sector,
-                                    bio_op(bio) & REQ_FUA);
+                                    bio->bi_opf & REQ_FUA);
                if (err) {
                        spin_unlock_irq(&nullb->lock);
                        return err;