]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
dm writecache: handle REQ_FUA
authorMaged Mokhtar <mmokhtar@petasan.org>
Wed, 23 Oct 2019 20:41:17 +0000 (22:41 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 13:33:22 +0000 (07:33 -0600)
BugLink: https://bugs.launchpad.net/bugs/1858424
commit c1005322ff02110a4df7f0033368ea015062b583 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/md/dm-writecache.c

index d06b8aa41e261847263f05f2ca74979f72ef45f3..43d1af1d817398a31fbeea520c517316e9d0e8b1 100644 (file)
@@ -1218,7 +1218,8 @@ bio_copy:
                        }
                } 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);