From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f182.google.com ([209.85.216.182]:36694 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753447AbdDLNBi (ORCPT ); Wed, 12 Apr 2017 09:01:38 -0400 Received: by mail-qt0-f182.google.com with SMTP id v3so21130622qtd.3 for ; Wed, 12 Apr 2017 06:01:37 -0700 (PDT) Message-ID: <1492002094.2937.4.camel@redhat.com> Subject: Re: [PATCH v2 06/17] mm: doc comment for scary spot in write_one_page From: Jeff Layton To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, tytso@mit.edu, jack@suse.cz, willy@infradead.org, neilb@suse.com, viro@zeniv.linux.org.uk Date: Wed, 12 Apr 2017 09:01:34 -0400 In-Reply-To: <20170412120614.6111-7-jlayton@redhat.com> References: <20170412120614.6111-1-jlayton@redhat.com> <20170412120614.6111-7-jlayton@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2017-04-12 at 08:06 -0400, Jeff Layton wrote: > Not sure what to do here just yet. > > Signed-off-by: Jeff Layton > --- > mm/page-writeback.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index de0dbf12e2c1..3ac8399dc984 100644 > --- a/mm/page-writeback.c > +++ b/mm/page-writeback.c > @@ -2388,6 +2388,12 @@ int write_one_page(struct page *page) > ret = mapping->a_ops->writepage(page, &wbc); > if (ret == 0) { > wait_on_page_writeback(page); > + /* > + * FIXME: is this racy? What guarantees that PG_error > + * will still be set once we get around to checking it? > + * What if writeback fails, but then a read is issued > + * before we check this, and that calls ClearPageError? > + */ > if (PageError(page)) > ret = -EIO; > } Ahh, we are always under the page lock here, and this is generally used for writing out directory pages anyway. I'm fine with dropping this patch unless someone else sees a problem here. -- Jeff Layton