From patchwork Thu Jan 22 23:36:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5689591 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 E91099F358 for ; Thu, 22 Jan 2015 23:37:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2643020272 for ; Thu, 22 Jan 2015 23:37:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 506B62026F for ; Thu, 22 Jan 2015 23:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527AbbAVXhl (ORCPT ); Thu, 22 Jan 2015 18:37:41 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:64222 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754442AbbAVXhl (ORCPT ); Thu, 22 Jan 2015 18:37:41 -0500 Received: by mail-pd0-f174.google.com with SMTP id ft15so4614571pdb.5 for ; Thu, 22 Jan 2015 15:37:40 -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=YjR6KG/8yI9tIagoBtAna4yc/EdqfBXbK2iAxCL++6yu0aojsauKsPodOFANb39qNV 2TR/HQ0MM7bqBdoF66WyK+ySpWJPGQs86IgWBPXzi3t8WfSBsHueTALCRTmGrfm8vzbO 0v27L7HKBgV76GYWYho8NmETxsEJPBd6jtns7b+SIgGm24F9byOOSor9o3knwTi2KfoM U6o8hEOETeBTXh/ope/O9U5qZcr632HqydBu3YLKcQ0aZ/gZjfbXaZ5UtCwzYMRbFpcH VOH02d6/tkJZefT2hbY4xRLPioV02oovWJK3I5TQoi6Mu3IKu080vfy//2S/n4zTDKl0 A0VA== X-Gm-Message-State: ALoCoQlGuqPssAoYnBW1kXSntpdCYD7vS2x/7sSqB125s4GnRIMyhJLT6KdqjxwaCDgPayZJJhgg X-Received: by 10.66.124.164 with SMTP id mj4mr6446393pab.83.1421969860734; Thu, 22 Jan 2015 15:37:40 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id fu1sm366817pdb.80.2015.01.22.15.37.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 15:37:40 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v5 28/51] nfs41: clear NFS_LAYOUT_RETURN if layoutreturn is sent or failed to send Date: Thu, 22 Jan 2015 15:36:00 -0800 Message-Id: <1421969783-92997-29-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421969783-92997-1-git-send-email-loghyr@primarydata.com> References: <1421969783-92997-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; }