Return-Path: Received: from mx2.suse.de ([195.135.220.15]:57893 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752228AbdEJLOu (ORCPT ); Wed, 10 May 2017 07:14:50 -0400 Date: Wed, 10 May 2017 13:14:46 +0200 From: Jan Kara To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, jfs-discussion@lists.sourceforge.net, linux-xfs@vger.kernel.org, cluster-devel@redhat.com, linux-f2fs-devel@lists.sourceforge.net, v9fs-developer@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-block@vger.kernel.org, dhowells@redhat.com, akpm@linux-foundation.org, hch@infradead.org, ross.zwisler@linux.intel.com, mawilcox@microsoft.com, jack@suse.com, viro@zeniv.linux.org.uk, corbet@lwn.net, neilb@suse.de, clm@fb.com, tytso@mit.edu, axboe@kernel.dk, josef@toxicpanda.com, hubcap@omnibond.com, rpeterso@redhat.com, bo.li.liu@oracle.com Subject: Re: [PATCH v4 12/27] cifs: set mapping error when page writeback fails in writepage or launder_pages Message-ID: <20170510111446.GD25137@quack2.suse.cz> References: <20170509154930.29524-1-jlayton@redhat.com> <20170509154930.29524-13-jlayton@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170509154930.29524-13-jlayton@redhat.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Tue 09-05-17 11:49:15, Jeff Layton wrote: > Signed-off-by: Jeff Layton > Reviewed-by: Christoph Hellwig Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/cifs/file.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/fs/cifs/file.c b/fs/cifs/file.c > index 21d404535739..0bee7f8d91ad 100644 > --- a/fs/cifs/file.c > +++ b/fs/cifs/file.c > @@ -2234,14 +2234,16 @@ cifs_writepage_locked(struct page *page, struct writeback_control *wbc) > set_page_writeback(page); > retry_write: > rc = cifs_partialpagewrite(page, 0, PAGE_SIZE); > - if (rc == -EAGAIN && wbc->sync_mode == WB_SYNC_ALL) > - goto retry_write; > - else if (rc == -EAGAIN) > + if (rc == -EAGAIN) { > + if (wbc->sync_mode == WB_SYNC_ALL) > + goto retry_write; > redirty_page_for_writepage(wbc, page); > - else if (rc != 0) > + } else if (rc != 0) { > SetPageError(page); > - else > + mapping_set_error(page->mapping, rc); > + } else { > SetPageUptodate(page); > + } > end_page_writeback(page); > put_page(page); > free_xid(xid); > -- > 2.9.3 > > -- Jan Kara SUSE Labs, CR