From patchwork Mon Feb 2 22:38:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5764991 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E395BF440 for ; Mon, 2 Feb 2015 22:40:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73197209EA for ; Mon, 2 Feb 2015 22:40:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90931209EC for ; Mon, 2 Feb 2015 22:40:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965360AbbBBWkg (ORCPT ); Mon, 2 Feb 2015 17:40:36 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:55429 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965185AbbBBWkg (ORCPT ); Mon, 2 Feb 2015 17:40:36 -0500 Received: by mail-pa0-f46.google.com with SMTP id lj1so87885874pab.5 for ; Mon, 02 Feb 2015 14:40:35 -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=IHA03TQ97Sd5uLCQwPuAet0uJLxTemH96ynjXAKA+ks=; b=SAWTTEzPccwqswuPRgbEue+iOP+pq6m49hy7CGnz6JCEQoWDIIIzBVLb5BDzG4OjUU RTAMBRGb/YjB1XaBTlwsZIfwodOBvKahN0XrkJYS3LUy71X+11HNNQMeFYxl0GL4VoKX cShsfw3pRUsHTWztLlDNNEGiyC2jlAUmqhblrertyoP6eDHMDvJjbBExDO1k0vcNOXlo yw0WFzXHrWFEa4k8zfKZT8LNaMn3Cia3U150A7bwtJvTTDu/qQrFq8/NGAEXMxE6PX/2 k4cCYx3/TLscqUgeGZnf44zwvo9A7gzQy/u52KXLmVC0x8CqQVbR3atRrxLNbd7RYQdA 0fCg== X-Gm-Message-State: ALoCoQmxfMTRF1a8oCcTl3GgZDl+LyMHzpY52bfKajqVDZI5ZrmF/GXTiDUzXckRLQEOxfZ4uOYI X-Received: by 10.70.36.204 with SMTP id s12mr32626710pdj.3.1422916835822; Mon, 02 Feb 2015 14:40:35 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id bx13sm94656pdb.19.2015.02.02.14.40.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 14:40:35 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v6 28/53] nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send Date: Mon, 2 Feb 2015 14:38:42 -0800 Message-Id: <1422916747-86649-29-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> References: <1422916747-86649-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 1943284..e19b5db 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7796,6 +7796,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; }