From patchwork Sat Aug 16 19:36:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Wang X-Patchwork-Id: 4730071 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 11E509F377 for ; Sat, 16 Aug 2014 19:37:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A4AA20145 for ; Sat, 16 Aug 2014 19:37:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEA4B2013A for ; Sat, 16 Aug 2014 19:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbaHPTg7 (ORCPT ); Sat, 16 Aug 2014 15:36:59 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:47415 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751452AbaHPTg6 (ORCPT ); Sat, 16 Aug 2014 15:36:58 -0400 Received: by mail-pd0-f170.google.com with SMTP id g10so5165349pdj.1 for ; Sat, 16 Aug 2014 12:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=GjN8+5u0jGUPkfH4/mZmZ5hcAy6jtMyDlbwLyKSr5U8=; b=wVcpdcH1fXxlATsoiVhdNFURD4FpeR2mP//oudEdISMSf5wGwIiXBnqHGEQTi5w4Gm LeGA6PgKbGi11RsoYmsbly63jFYP2TrjkIqIW8zIX6xvkYg3wHbepm4LSOi93JfiPyWO wQj9Wjw4Fihy7cMDU3a4/DUkFz5ux2/gcUSLscm76b4V2KBXgF5KKY5RLlySBV7K9ZWm 4lg8TpU7W2CZ3F1qm+zaVdVRvFUnIHW7uurJT7T+wTjGpKo/M7Kl+Nlyn4BwO1T5MkA6 2vqOTwnqDCeCpYe0uUbeTy8Fi0FbqJ7dHwR8Af9QIJzpXhzddGz6HbnpLL7x83B9HIDg ST3Q== X-Received: by 10.68.194.194 with SMTP id hy2mr21154411pbc.149.1408217818148; Sat, 16 Aug 2014 12:36:58 -0700 (PDT) Received: from linux-6brj.site (c-67-170-205-66.hsd1.ca.comcast.net. [67.170.205.66]) by mx.google.com with ESMTPSA id cf2sm11572419pbb.68.2014.08.16.12.36.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Aug 2014 12:36:57 -0700 (PDT) From: Cong Wang To: linux-kernel@vger.kernel.org Cc: linux-nfs@vger.kernel.org, "Eric W. Biederman" , Trond Myklebust , Dan Aloni , Cong Wang Subject: [PATCH v2] nfs: fix kernel warning when removing proc entry Date: Sat, 16 Aug 2014 12:36:46 -0700 Message-Id: <1408217806-25877-1-git-send-email-xiyou.wangcong@gmail.com> X-Mailer: git-send-email 1.8.1.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 I saw the following kernel warning: [ 1852.321222] ------------[ cut here ]------------ [ 1852.326527] WARNING: CPU: 0 PID: 118 at fs/proc/generic.c:521 remove_proc_entry+0x154/0x16b() [ 1852.335630] remove_proc_entry: removing non-empty directory 'fs/nfsfs', leaking at least 'volumes' [ 1852.344084] CPU: 0 PID: 118 Comm: kworker/u8:2 Not tainted 3.16.0+ #540 [ 1852.350036] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 1852.354992] Workqueue: netns cleanup_net [ 1852.358701] 0000000000000000 ffff880116f2fbd0 ffffffff819c03e9 ffff880116f2fc18 [ 1852.366474] ffff880116f2fc08 ffffffff810744ee ffffffff811e0e6e ffff8800d4e96238 [ 1852.373507] ffffffff81dbe665 ffff8800d46a5948 0000000000000005 ffff880116f2fc68 [ 1852.380224] Call Trace: [ 1852.381976] [] dump_stack+0x4d/0x66 [ 1852.385495] [] warn_slowpath_common+0x7a/0x93 [ 1852.389869] [] ? remove_proc_entry+0x154/0x16b [ 1852.393987] [] warn_slowpath_fmt+0x4c/0x4e [ 1852.397999] [] remove_proc_entry+0x154/0x16b [ 1852.402034] [] nfs_fs_proc_net_exit+0x53/0x56 [ 1852.406136] [] nfs_net_exit+0x12/0x1d [ 1852.409774] [] ops_exit_list+0x44/0x55 [ 1852.413529] [] cleanup_net+0xee/0x182 [ 1852.417198] [] process_one_work+0x209/0x40d [ 1852.502320] [] ? process_one_work+0x162/0x40d [ 1852.587629] [] worker_thread+0x1f0/0x2c7 [ 1852.673291] [] ? process_scheduled_works+0x2f/0x2f [ 1852.759470] [] kthread+0xc9/0xd1 [ 1852.843099] [] ? finish_task_switch+0x3a/0xce [ 1852.926518] [] ? __kthread_parkme+0x61/0x61 [ 1853.008565] [] ret_from_fork+0x7c/0xb0 [ 1853.076477] [] ? __kthread_parkme+0x61/0x61 [ 1853.140653] ---[ end trace 69c4c6617f78e32d ]--- It looks wrong that we add "/proc/net/nfsfs" in nfs_fs_proc_net_init() while remove "/proc/fs/nfsfs" in nfs_fs_proc_net_exit(). Fixes: commit 65b38851a17 (NFS: Fix /proc/fs/nfsfs/servers and /proc/fs/nfsfs/volumes) Cc: Eric W. Biederman Cc: Trond Myklebust Cc: Dan Aloni Signed-off-by: Cong Wang Tested-by: Matt Mullins --- v2 - fix nfs_fs_proc_net_init() as well fs/nfs/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 1c5ff6d..c117b96 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1418,7 +1418,7 @@ int nfs_fs_proc_net_init(struct net *net) error_2: remove_proc_entry("servers", nn->proc_nfsfs); error_1: - remove_proc_entry("fs/nfsfs", NULL); + remove_proc_entry("nfsfs", net->proc_net); error_0: return -ENOMEM; } @@ -1429,7 +1429,7 @@ void nfs_fs_proc_net_exit(struct net *net) remove_proc_entry("volumes", nn->proc_nfsfs); remove_proc_entry("servers", nn->proc_nfsfs); - remove_proc_entry("fs/nfsfs", NULL); + remove_proc_entry("nfsfs", net->proc_net); } /*