Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10b9bf59 authored by Maged Mokhtar's avatar Maged Mokhtar Committed by Greg Kroah-Hartman
Browse files

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: default avatarMaged Mokhtar <mmokhtar@petasan.org>
Acked-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7c07d026
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1223,7 +1223,8 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)
			}
		} 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);
		else
			writecache_schedule_autocommit(wc);