From patchwork Sun Aug 30 20:10:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 7098081 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C19E59F1CD for ; Sun, 30 Aug 2015 20:10:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBD3A200DB for ; Sun, 30 Aug 2015 20:10:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15927200C1 for ; Sun, 30 Aug 2015 20:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbbH3UKm (ORCPT ); Sun, 30 Aug 2015 16:10:42 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:34736 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbbH3UKm (ORCPT ); Sun, 30 Aug 2015 16:10:42 -0400 Received: by pabzx8 with SMTP id zx8so115744448pab.1 for ; Sun, 30 Aug 2015 13:10:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=I8N1aYQWd2YxJnm7XqBR1HsdNh/c0iahwHkWEFSlbrs=; b=LiGmIZM74KXFnXjdciPMMsQeFokSYi2nL9VE63viGwI2IAUMG0v1YHTKeDVwdEujZA 6gSu86l4Si7V/7HwfqHhKGsA1SrL5kG/NW7LTstj9GI/eELglSMZzpvxn2VYFil4n0zA VtxAT/x+md42oFMOB1yM2q34eakSS+lnHi4Hpn/l4prd+VcwmoNIIK+CW2pwwH8fyR49 81cmWlswrPbPE5AbxklReRO+JNmTFj02g2aPLzA+6+Bd4WtRZHjyUW0SrAABwGt59uYk 9YTDa/j9ZF2Y8LGNlQx/834E3Q7Mt89W8SgSCLEETtER63Gvby+hFUoq59+msNnBFUAg RCwg== X-Gm-Message-State: ALoCoQndwEyuJUDry7EmdrjjEGHwP8Tz7+53L6xWr9yBifDLPfL6z3WkFhMu0DfG8BNV+/pHHc4g X-Received: by 10.67.15.36 with SMTP id fl4mr31246558pad.152.1440965441590; Sun, 30 Aug 2015 13:10:41 -0700 (PDT) Received: from leira.trondhjem.org.localdomain ([216.2.50.205]) by smtp.gmail.com with ESMTPSA id kl6sm12073459pdb.79.2015.08.30.13.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Aug 2015 13:10:41 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH] NFSv4.1/flexfiles: Don't mark the entire deviceid as bad for file errors Date: Sun, 30 Aug 2015 13:10:39 -0700 Message-Id: <1440965439-11746-1-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.4.3 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the file was fenced and/or has been deleted on the DS, then we want to retry pNFS after a layoutreturn with error report. If the server cannot fix the problem, then we rely on it to tell us so in the response to the LAYOUTGET. Signed-off-by: Trond Myklebust --- fs/nfs/flexfilelayout/flexfilelayout.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 4ec624cfcf8b..61ccf1122494 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1075,18 +1075,26 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task, if (task->tk_status >= 0) return 0; - if (task->tk_status != -EJUKEBOX) { + switch (task->tk_status) { + /* File access problems. Don't mark the device as unavailable */ + case -EACCES: + case -ESTALE: + case -EISDIR: + case -EBADHANDLE: + case -ELOOP: + case -ENOSPC: + break; + case -EJUKEBOX: + nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); + goto out_retry; + default: dprintk("%s DS connection error %d\n", __func__, task->tk_status); nfs4_mark_deviceid_unavailable(devid); - if (ff_layout_has_available_ds(lseg)) - return -NFS4ERR_RESET_TO_PNFS; - else - return -NFS4ERR_RESET_TO_MDS; } - - if (task->tk_status == -EJUKEBOX) - nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY); + /* FIXME: Need to prevent infinite looping here. */ + return -NFS4ERR_RESET_TO_PNFS; +out_retry: task->tk_status = 0; rpc_restart_call(task); rpc_delay(task, NFS_JUKEBOX_RETRY_TIME);