Skip to content

Commit a466245

Browse files
hramrachsnitm
authored andcommitted
dm writecache: reject asynchronous pmem devices
DM writecache does not handle asynchronous pmem. Reject it when supplied as cache. Link: https://lore.kernel.org/linux-nvdimm/[email protected]/ Fixes: 6e84200 ("virtio-pmem: Add virtio pmem driver") Signed-off-by: Michal Suchanek <[email protected]> Acked-by: Mikulas Patocka <[email protected]> Cc: [email protected] # 5.3+ Signed-off-by: Mike Snitzer <[email protected]>
1 parent 382761d commit a466245

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/md/dm-writecache.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,12 @@ static int writecache_ctr(struct dm_target *ti, unsigned argc, char **argv)
22662266
}
22672267

22682268
if (WC_MODE_PMEM(wc)) {
2269+
if (!dax_synchronous(wc->ssd_dev->dax_dev)) {
2270+
r = -EOPNOTSUPP;
2271+
ti->error = "Asynchronous persistent memory not supported as pmem cache";
2272+
goto bad;
2273+
}
2274+
22692275
r = persistent_memory_claim(wc);
22702276
if (r) {
22712277
ti->error = "Unable to map persistent memory for cache";

0 commit comments

Comments
 (0)