Skip to content

Commit

Permalink
dm writecache: handle REQ_FUA
Browse files Browse the repository at this point in the history
Call writecache_flush() on REQ_FUA in writecache_map().

Cc: stable@vger.kernel.org # 4.18+
Signed-off-by: Maged Mokhtar <mmokhtar@petasan.org>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Maged Mokhtar authored and Mike Snitzer committed Nov 5, 2019
1 parent 8dd8587 commit c100532
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/dm-writecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,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);
Expand Down

0 comments on commit c100532

Please sign in to comment.