From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 17 Aug 2016 19:20:21 +0200 From: Michal Hocko To: Bart Van Assche Cc: Andrew Morton , Mel Gorman , Jan Kara , Hugh Dickins , Oleg Nesterov , "linux-mm@kvack.org" , Linux-fsdevel Subject: Re: [PATCH] do_generic_file_read(): Fail immediately if killed Message-ID: <20160817172021.GD20719@dhcp22.suse.cz> References: <63068e8e-8bee-b208-8441-a3c39a9d9eb6@sandisk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63068e8e-8bee-b208-8441-a3c39a9d9eb6@sandisk.com> Sender: owner-linux-mm@kvack.org List-ID: On Tue 16-08-16 17:00:43, Bart Van Assche wrote: > If a fatal signal has been received, fail immediately instead of > trying to read more data. > > See also commit ebded02788b5 ("mm: filemap: avoid unnecessary > calls to lock_page when waiting for IO to complete during a read") > > Signed-off-by: Bart Van Assche > Cc: Mel Gorman > Cc: Jan Kara > Cc: Hugh Dickins > Cc: Oleg Nesterov If not anything else it makes code more readable because the real error is hidden in page_not_up_to_date: currently... Acked-by: Michal Hocko > --- > mm/filemap.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/filemap.c b/mm/filemap.c > index 2a9e84f6..bd8ab63 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1721,7 +1721,9 @@ find_page: > * wait_on_page_locked is used to avoid unnecessarily > * serialisations and why it's safe. > */ > - wait_on_page_locked_killable(page); > + error = wait_on_page_locked_killable(page); > + if (unlikely(error)) > + goto readpage_error; > if (PageUptodate(page)) > goto page_ok; > > -- > 2.9.2 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org