diff options
| author | guolingxing <guolingxing@tju.edu.cn> | 2026-10-14 03:11:50 +0000 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-11-03 18:30:28 +0100 |
| commit | b1310cb291935c788f34ed6eb1e7e9b42cfac045 (patch) | |
| tree | 8b9332601322f1fc234f9b37466e8e241ee776c0 /tools/perf/scripts/python | |
| parent | 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4 (diff) | |
dm-pcache: do not advance dirty_tail after backing flush failure
After all writeback bios for a kset complete, writeback_ctx_end()
flushes the backing device and then advances the persistent dirty_tail.
However, backing_dev_flush() discards the error returned by
blkdev_issue_flush(), so dirty_tail is advanced even when the written
data is not known to be durable.
dirty_tail points to the first kset that still requires writeback.
Advancing it causes recovery to treat the preceding kset as clean and
allows its cache copy to eventually be reclaimed by garbage collection.
If the backing device flush failed, a subsequent power failure may
therefore result in data loss.
Make backing_dev_flush() return the flush status and handle a flush
failure like a writeback I/O failure. Leave dirty_tail unchanged so
that the same kset will be retried.
Fixes: 1d57628ff95b ("dm-pcache: add persistent cache target in device-mapper")
Cc: stable@vger.kernel.org
Signed-off-by: guolingxing <guolingxing@tju.edu.cn>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@linux.dev>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
