lkml.org 
[lkml]   [2014]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: readahead: fix do_readahead for no readpage(s)
On Tue, Jan 28, 2014 at 11:14:19AM +0000, Mark Rutland wrote:
> Commit 63d0f0a3c7e1 (mm/readahead.c:do_readhead(): don't check for
> ->readpage) unintentionally made do_readahead return 0 for all valid
> files regardless of whether readahead was supported, rather than the
> expected -EINVAL. This gets forwarded on to userspace, and results in
> sys_readahead appearing to succeed in cases that don't make sense (e.g.
> when called on pipes or sockets). This issue is detected by the LTP
> readahead01 testcase.
>
> As the exact return value of force_page_cache_readahead is currently
> never used, we can simplify it to return only 0 or -EINVAL (when
> readpage or readpages is missing). With that in place we can simply
> forward on the return value of force_page_cache_readahead in
> do_readahead.
>
> This patch performs said change, restoring the expected semantics.
>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

--
Kirill A. Shutemov


\
 
 \ /
  Last update: 2014-01-28 13:21    [W:0.056 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site