]> git.baikalelectronics.ru Git - kernel.git/commit
dm writecache: flush origin device when writing and cache is full
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 15 Jun 2021 17:45:55 +0000 (13:45 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 16 Jun 2021 16:57:14 +0000 (12:57 -0400)
commit105e9841a59e50202eb2e764046ed1c8e19e24ed
tree816934d46e7a67debf1b3612260750cbddb34b5d
parent6eadfe9bf2808187db25eca5ac490f0146f689ff
dm writecache: flush origin device when writing and cache is full

Commit 8ee9d020f3801f79f5b30d1ef2f1b3312dc794b9 ("dm writecache: do
direct write if the cache is full") changed dm-writecache, so that it
writes directly to the origin device if the cache is full.
Unfortunately, it doesn't forward flush requests to the origin device,
so that there is a bug where flushes are being ignored.

Fix this by adding missing flush forwarding.

For PMEM mode, we fix this bug by disabling direct writes to the origin
device, because it performs better.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 8ee9d020f380 ("dm writecache: do direct write if the cache is full")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c