Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754028AbdDLMID (ORCPT ); Wed, 12 Apr 2017 08:08:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44864 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753827AbdDLMGd (ORCPT ); Wed, 12 Apr 2017 08:06:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9491D7D0C8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jlayton@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9491D7D0C8 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 Subject: [PATCH v2 16/17] cifs: set mapping error when page writeback fails in writepage or launder_pages Date: Wed, 12 Apr 2017 08:06:13 -0400 Message-Id: <20170412120614.6111-17-jlayton@redhat.com> In-Reply-To: <20170412120614.6111-1-jlayton@redhat.com> References: <20170412120614.6111-1-jlayton@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 12 Apr 2017 12:06:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 907 Lines: 32 Signed-off-by: Jeff Layton --- fs/cifs/file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index aa3debbba826..d9a3657b8d43 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) + if (rc == -EAGAIN && wbc->sync_mode == WB_SYNC_ALL) { goto retry_write; - else if (rc == -EAGAIN) + } else if (rc == -EAGAIN) { 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