]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
null_blk: fix passing of REQ_FUA flag in null_handle_rq
authorHou Pu <houpu@bytedance.com>
Fri, 21 Aug 2020 08:34:42 +0000 (04:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:26:55 +0000 (11:26 +0200)
[ Upstream commit 2d62e6b038e729c3e4bfbfcfbd44800ef0883680 ]

REQ_FUA should be checked using rq->cmd_flags instead of req_op().

Fixes: deb78b419dfda ("nullb: emulate cache")
Signed-off-by: Hou Pu <houpu@bytedance.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/null_blk_main.c

index c4454cfc6d530257f249430c6a212eb592f06573..13eae973eaea4e98bfcabf1f4b6cb7ee84b982b7 100644 (file)
@@ -1072,7 +1072,7 @@ static int null_handle_rq(struct nullb_cmd *cmd)
                len = bvec.bv_len;
                err = null_transfer(nullb, bvec.bv_page, len, bvec.bv_offset,
                                     op_is_write(req_op(rq)), sector,
-                                    req_op(rq) & REQ_FUA);
+                                    rq->cmd_flags & REQ_FUA);
                if (err) {
                        spin_unlock_irq(&nullb->lock);
                        return err;