Skip to content

Commit

Permalink
null_blk: fix passing of REQ_FUA flag in null_handle_rq
Browse files Browse the repository at this point in the history
[ Upstream commit 2d62e6b ]

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

Fixes: deb78b4 ("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>
  • Loading branch information
Hou Pu authored and gregkh committed Sep 3, 2020
1 parent 88994ac commit 2fc8fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/null_blk_main.c
Expand Up @@ -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;
Expand Down

0 comments on commit 2fc8fa5

Please sign in to comment.