From patchwork Wed Jan 14 16:44:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5633501 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 064FF9F357 for ; Wed, 14 Jan 2015 16:46:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BBE220145 for ; Wed, 14 Jan 2015 16:46:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60EFB20123 for ; Wed, 14 Jan 2015 16:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752704AbbANQqO (ORCPT ); Wed, 14 Jan 2015 11:46:14 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:42907 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbbANQqF (ORCPT ); Wed, 14 Jan 2015 11:46:05 -0500 Received: by mail-pd0-f169.google.com with SMTP id z10so10749325pdj.0 for ; Wed, 14 Jan 2015 08:46:05 -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=BwmFdEvNcjH8xP034QIxS8s0VLB0qTokmwVx3rt4hg3B9bPmM3apqv6QeMExi/0TYa 1Hr3BLbNPpRzsYeoT7EISfZ2lasqAjlYFAIzc3VC+evxWOKBdqM23SNqEYu6aZQv6gmq 4i3JAVPEJycexLR7vJH/IBVeC+RdskU70H7NUv7Iw9Bzpn9xmvaVTGD/A7ACl1//aa9e /ilWUQEgLddJ5QlJ75ZklMq36LpkdIyLJTS5x7mNp7JVUBR24KEZSQ6T1HSwuZ5EnzQY 2UJoT106mMn0ivsUECjcYSOgwqWspHl43PIl0jPZDIIiy38udHym8+VDxpv49ni6/3rG l6Fg== X-Gm-Message-State: ALoCoQn9GNNS/LUuw0qPO72RU9z1PMmLTggdPitnwUZmx0ro8lT3JNTUpWXmNh3IGynAH5R3Mu1x X-Received: by 10.70.118.202 with SMTP id ko10mr7344045pdb.48.1421253965385; Wed, 14 Jan 2015 08:46:05 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id u7sm12239039pdp.45.2015.01.14.08.46.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 08:46:04 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v4 38/50] nfs41: add a debug warning if we destroy an unempty layout Date: Wed, 14 Jan 2015 08:44:44 -0800 Message-Id: <1421253896-73106-39-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421253896-73106-1-git-send-email-loghyr@primarydata.com> References: <1421253896-73106-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);