projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nl80211: always check nla_nest_start() return value
[cascardo/linux.git]
/
mm
/
readahead.c
diff --git
a/mm/readahead.c
b/mm/readahead.c
index
65ec288
..
c8a955b
100644
(file)
--- a/
mm/readahead.c
+++ b/
mm/readahead.c
@@
-8,6
+8,7
@@
*/
#include <linux/kernel.h>
*/
#include <linux/kernel.h>
+#include <linux/dax.h>
#include <linux/gfp.h>
#include <linux/export.h>
#include <linux/blkdev.h>
#include <linux/gfp.h>
#include <linux/export.h>
#include <linux/blkdev.h>
@@
-544,6
+545,14
@@
do_readahead(struct address_space *mapping, struct file *filp,
if (!mapping || !mapping->a_ops)
return -EINVAL;
if (!mapping || !mapping->a_ops)
return -EINVAL;
+ /*
+ * Readahead doesn't make sense for DAX inodes, but we don't want it
+ * to report a failure either. Instead, we just return success and
+ * don't do any work.
+ */
+ if (dax_mapping(mapping))
+ return 0;
+
return force_page_cache_readahead(mapping, filp, index, nr);
}
return force_page_cache_readahead(mapping, filp, index, nr);
}