From patchwork Fri Dec 10 15:44:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 398732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBAFihLZ014230 for ; Fri, 10 Dec 2010 15:44:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755905Ab0LJPon (ORCPT ); Fri, 10 Dec 2010 10:44:43 -0500 Received: from mail-gw0-f42.google.com ([74.125.83.42]:53270 "EHLO mail-gw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755609Ab0LJPom (ORCPT ); Fri, 10 Dec 2010 10:44:42 -0500 Received: by mail-gw0-f42.google.com with SMTP id 20so3171169gwb.1 for ; Fri, 10 Dec 2010 07:44:42 -0800 (PST) Received: by 10.100.9.3 with SMTP id 3mr591199ani.49.1291995882418; Fri, 10 Dec 2010 07:44:42 -0800 (PST) Received: from salusa.poochiereds.net (cpe-071-070-153-003.nc.res.rr.com [71.70.153.3]) by mx.google.com with ESMTPS id b27sm528877ana.8.2010.12.10.07.44.41 (version=SSLv3 cipher=RC4-MD5); Fri, 10 Dec 2010 07:44:41 -0800 (PST) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 01/13] cifs: don't fail writepages on -EAGAIN errors Date: Fri, 10 Dec 2010 10:44:25 -0500 Message-Id: <1291995877-2276-2-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1291995877-2276-1-git-send-email-jlayton@redhat.com> References: <1291995877-2276-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Dec 2010 15:44:43 +0000 (UTC) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fe16f6d..8e57370 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1430,6 +1430,7 @@ retry: break; } if (n_iov) { +retry_write: open_file = find_writable_file(CIFS_I(mapping->host), false); if (!open_file) { @@ -1445,22 +1446,20 @@ retry: cifs_update_eof(cifsi, offset, bytes_written); } - if (rc || bytes_written < bytes_to_write) { - cERROR(1, "Write2 ret %d, wrote %d", - rc, bytes_written); - mapping_set_error(mapping, rc); - } else { + /* retry on data-integrity flush */ + if (rc == -EAGAIN && wbc->sync_mode == WB_SYNC_ALL) + goto retry_write; + + if (!rc) cifs_stats_bytes_written(tcon, bytes_written); - } + else if (rc != -EAGAIN) + mapping_set_error(mapping, rc); for (i = 0; i < n_iov; i++) { page = pvec.pages[first + i]; - /* Should we also set page error on - success rc but too little data written? */ - /* BB investigate retry logic on temporary - server crash cases and how recovery works - when page marked as error */ - if (rc) + if (rc == -EAGAIN) + redirty_page_for_writepage(wbc, page); + else if (rc != 0) SetPageError(page); kunmap(page); unlock_page(page);