X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=mm%2Freadahead.c;h=c8a955b1297e0b60fb2efffdf3fc2bb71cfc4630;hb=b59abfbed638037f3b51eeb73266892cd2df177f;hp=65ec288dc057e874a661fd372501454c32cc2bd4;hpb=44cee85a8824464e7e951e590243c2a85d79c494;p=cascardo%2Flinux.git diff --git a/mm/readahead.c b/mm/readahead.c index 65ec288dc057..c8a955b1297e 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -544,6 +545,14 @@ do_readahead(struct address_space *mapping, struct file *filp, 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); }