提交 6a6661b0 编写于 作者: M Maged Mokhtar 提交者: Xie XiuQi

dm writecache: handle REQ_FUA

commit c1005322ff02110a4df7f0033368ea015062b583 upstream.

Call writecache_flush() on REQ_FUA in writecache_map().

Cc: stable@vger.kernel.org # 4.18+
Signed-off-by: NMaged Mokhtar <mmokhtar@petasan.org>
Acked-by: NMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3a53416a
...@@ -1223,7 +1223,8 @@ static int writecache_map(struct dm_target *ti, struct bio *bio) ...@@ -1223,7 +1223,8 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)
} }
} while (bio->bi_iter.bi_size); } while (bio->bi_iter.bi_size);
if (unlikely(wc->uncommitted_blocks >= wc->autocommit_blocks)) if (unlikely(bio->bi_opf & REQ_FUA ||
wc->uncommitted_blocks >= wc->autocommit_blocks))
writecache_flush(wc); writecache_flush(wc);
else else
writecache_schedule_autocommit(wc); writecache_schedule_autocommit(wc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册