[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140128115316.GA22934@node.dhcp.inet.fi>
Date: Tue, 28 Jan 2014 13:53:16 +0200
From: "Kirill A. Shutemov" <kirill@...temov.name>
To: Mark Rutland <mark.rutland@....com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [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@....com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
--
Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists