Merge tag 'random_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / dax / super.c
index ecdc292..2b2332b 100644 (file)
@@ -124,10 +124,19 @@ int __bdev_dax_supported(struct super_block *sb, int blocksize)
                return len < 0 ? len : -EIO;
        }
 
-       if ((IS_ENABLED(CONFIG_FS_DAX_LIMITED) && pfn_t_special(pfn))
-                       || pfn_t_devmap(pfn))
+       if (IS_ENABLED(CONFIG_FS_DAX_LIMITED) && pfn_t_special(pfn)) {
+               /*
+                * An arch that has enabled the pmem api should also
+                * have its drivers support pfn_t_devmap()
+                *
+                * This is a developer warning and should not trigger in
+                * production. dax_flush() will crash since it depends
+                * on being able to do (page_address(pfn_to_page())).
+                */
+               WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API));
+       } else if (pfn_t_devmap(pfn)) {
                /* pass */;
-       else {
+       else {
                pr_debug("VFS (%s): error: dax support not enabled\n",
                                sb->s_id);
                return -EOPNOTSUPP;