summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2020-04-01 19:11:25 +0300
committerDan Williams <dan.j.williams@intel.com>2020-04-03 05:15:03 +0300
commit4e4ced93794acb42adb19484132966defba8f3a6 (patch)
tree2a63f73c19e052bb5b7fa283545cd9349447d21e /drivers/md
parent4f3b4f161d7a070d2181dbcf7fbd97c7631d5c24 (diff)
downloadlinux-4e4ced93794acb42adb19484132966defba8f3a6.tar.xz
dax: Move mandatory ->zero_page_range() check in alloc_dax()
zero_page_range() dax operation is mandatory for dax devices. Right now that check happens in dax_zero_page_range() function. Dan thinks that's too late and its better to do the check earlier in alloc_dax(). I also modified alloc_dax() to return pointer with error code in it in case of failure. Right now it returns NULL and caller assumes failure happened due to -ENOMEM. But with this ->zero_page_range() check, I need to return -EINVAL instead. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Link: https://lore.kernel.org/r/20200401161125.GB9398@redhat.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index aa72d9e757c1..6504f0a358e5 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2005,7 +2005,7 @@ static struct mapped_device *alloc_dev(int minor)
if (IS_ENABLED(CONFIG_DAX_DRIVER)) {
md->dax_dev = alloc_dax(md, md->disk->disk_name,
&dm_dax_ops, 0);
- if (!md->dax_dev)
+ if (IS_ERR(md->dax_dev))
goto bad;
}