From patchwork Tue Dec 16 19:01:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5503121 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1A9AA9F326 for ; Tue, 16 Dec 2014 19:03:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F255209C1 for ; Tue, 16 Dec 2014 19:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6596920A18 for ; Tue, 16 Dec 2014 19:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbaLPTDS (ORCPT ); Tue, 16 Dec 2014 14:03:18 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:57860 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312AbaLPTDR (ORCPT ); Tue, 16 Dec 2014 14:03:17 -0500 Received: by mail-pd0-f181.google.com with SMTP id v10so14492690pde.40 for ; Tue, 16 Dec 2014 11:03:17 -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=2Vh5/7oC1Op7NYucu6Ochpy0OYzTsAKrz9otdKCFbMU=; b=gNsxE3UYkUZYItDBwgy6t1HL5HH7Z1qxzjH9ZSWlAJbEpPRGDCQ3z6yeUPlJxaTrIT mvjKlCRecXq1xYBzIaXNaSxlV4ngzy3s8F8zO87cQQUlOGuY8wVVNohseYbdI707/poT CvHh2p7R2hWWbDOIQiU2TBr7bJp+symV2zknZSTqy84Vr6rnm9HqHtw/+N5j2lTxRyOP DPE1IdY3m6Yp7TIVlRU3FHCmQXFdJF3HFN26ator/Ok66jRq8lm2vHLP0keLSrdMJMgc p91N7qTh6TT+8z6Aba2F8nKZivCv6p9QqJ8Bq9KDDTxnwNofx4GtIrSCLdWZrisuLp88 ddGQ== X-Gm-Message-State: ALoCoQkN96Ub+Z8eiCijXY/H4kdJpqf8Ih9ZzDRUt/UABqy/TwNC0cpRGGId+6wUYM0xZJuF6PND X-Received: by 10.68.251.37 with SMTP id zh5mr43846901pbc.120.1418756597318; Tue, 16 Dec 2014 11:03:17 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id q4sm1620669pdh.79.2014.12.16.11.03.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 11:03:16 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH 38/50] nfs41: add a debug warning if we destroy an unempty layout Date: Tue, 16 Dec 2014 11:01:41 -0800 Message-Id: <1418756513-95187-39-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 we can detect the case if some layout segments are still pinned which is surely a bug that we need to fix. Signed-off-by: Peng Tao --- fs/nfs/pnfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 5f7c422..e123cfc 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -242,6 +242,8 @@ pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo) struct inode *inode = lo->plh_inode; if (atomic_dec_and_lock(&lo->plh_refcount, &inode->i_lock)) { + if (!list_empty(&lo->plh_segs)) + WARN_ONCE(1, "NFS: BUG unfreed layout segments.\n"); pnfs_detach_layout_hdr(lo); spin_unlock(&inode->i_lock); pnfs_free_layout_hdr(lo);