From patchwork Tue Dec 16 19:01:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5503011 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AE97EBEEA8 for ; Tue, 16 Dec 2014 19:02:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBFD0209BD for ; Tue, 16 Dec 2014 19:02:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18965209C4 for ; Tue, 16 Dec 2014 19:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281AbaLPTCy (ORCPT ); Tue, 16 Dec 2014 14:02:54 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:51220 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbaLPTCx (ORCPT ); Tue, 16 Dec 2014 14:02:53 -0500 Received: by mail-pa0-f42.google.com with SMTP id et14so14637534pad.15 for ; Tue, 16 Dec 2014 11:02:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8dWG6NnfV9B6GJoANRFKa6Qt9nqDPN0TBASZyW0DtMI=; b=hoiWZCLYJ6+BsAlQYtjI/ioNgJxPohpEQz/ZZvBXjkTdyinJKzRvDPPeUuV+K61NCO JoBr/7smU4FuMiz068v1r0FDV8rdSdzjWgbr5ky5QUgYkZzjXY/GmbIOJtC9PwlT9HFf lDwmNeQY8mLfUoK4sQVfPLXVYU9yKPNfc2JYZyS2JpZpRo5z7Oh2bojHcLVgQXoQRxk8 tKk3lpuCqOmuF5VVIjCMXAbMysQdw8XQS4aSCskGYcOIQ/MeVQWiZJI9w0wXNQccDTlN RrC+7COpAbohvAZnWhTqnxCC0ods0UTf8wLraDVPGRE472J7RexDWaLjkjTmeXPfyXqY xvSw== X-Gm-Message-State: ALoCoQnPjmnVWEgwy6BFTYHcyt5sdPsu4eKeJQ+cwK246nMxiCl17gv8x89KIPuZyKKDdctefDg2 X-Received: by 10.68.251.37 with SMTP id zh5mr43843734pbc.120.1418756573175; Tue, 16 Dec 2014 11:02:53 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id q4sm1620669pdh.79.2014.12.16.11.02.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 11:02:52 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH 28/50] nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send Date: Tue, 16 Dec 2014 11:01:31 -0800 Message-Id: <1418756513-95187-29-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1418756513-95187-1-git-send-email-loghyr@primarydata.com> References: <1418756513-95187-1-git-send-email-loghyr@primarydata.com> 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 From: Peng Tao So that pnfs path is not disabled for ever. Signed-off-by: Peng Tao Signed-off-by: Tom Haynes --- fs/nfs/nfs4proc.c | 1 + fs/nfs/pnfs.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index b5bbe35..bf5ef58 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7786,6 +7786,7 @@ static void nfs4_layoutreturn_release(void *calldata) spin_lock(&lo->plh_inode->i_lock); if (lrp->res.lrs_present) pnfs_set_layout_stateid(lo, &lrp->res.stateid, true); + clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); lo->plh_block_lgets--; spin_unlock(&lo->plh_inode->i_lock); pnfs_put_layout_hdr(lrp->args.layout); diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e9acfcf..63992c8 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -921,6 +921,11 @@ pnfs_send_layoutreturn(struct pnfs_layout_hdr *lo, nfs4_stateid stateid, status = nfs4_proc_layoutreturn(lrp); out: + if (status) { + spin_lock(&ino->i_lock); + clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); + spin_unlock(&ino->i_lock); + } dprintk("<-- %s status: %d\n", __func__, status); return status; }