]> git.baikalelectronics.ru Git - kernel.git/commit
block: set REQ_SYNC if we clear REQ_FUA|REQ_PREFLUSH
authorJens Axboe <axboe@fb.com>
Wed, 9 Nov 2016 02:39:28 +0000 (19:39 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 9 Nov 2016 02:39:28 +0000 (19:39 -0700)
commit29b3d5ef557796e00823221424765561b4940bae
tree8adef3f0d868cdb67dd8d4aba11edf210341ebdf
parent3bddf1035ceeba1bd216c1edbf16ac9d8c1001e8
block: set REQ_SYNC if we clear REQ_FUA|REQ_PREFLUSH

If we insert a flush request, we clear REQ_PREFLUSH and/or REQ_FUA,
depending on flush settings. Since op_is_sync() factors those flags
in for deciding whether this request is sync or not, we should
set REQ_SYNC to avoid screwing up this accounting.

This should be less fragile.

Reported-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: bfd23d80bb0 ("block: treat REQ_FUA and REQ_PREFLUSH as synchronous")
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-flush.c