Cong Wang
21e81002f9
nfs: fix kernel warning when removing proc entry
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] [<ffffffff819c03e9>] dump_stack+0x4d/0x66
[ 1852.385495] [<ffffffff810744ee>] warn_slowpath_common+0x7a/0x93
[ 1852.389869] [<ffffffff811e0e6e>] ? remove_proc_entry+0x154/0x16b
[ 1852.393987] [<ffffffff8107457b>] warn_slowpath_fmt+0x4c/0x4e
[ 1852.397999] [<ffffffff811e0e6e>] remove_proc_entry+0x154/0x16b
[ 1852.402034] [<ffffffff8129c73d>] nfs_fs_proc_net_exit+0x53/0x56
[ 1852.406136] [<ffffffff812a103b>] nfs_net_exit+0x12/0x1d
[ 1852.409774] [<ffffffff81785bc9>] ops_exit_list+0x44/0x55
[ 1852.413529] [<ffffffff81786389>] cleanup_net+0xee/0x182
[ 1852.417198] [<ffffffff81088c9e>] process_one_work+0x209/0x40d
[ 1852.502320] [<ffffffff81088bf7>] ? process_one_work+0x162/0x40d
[ 1852.587629] [<ffffffff810890c1>] worker_thread+0x1f0/0x2c7
[ 1852.673291] [<ffffffff81088ed1>] ? process_scheduled_works+0x2f/0x2f
[ 1852.759470] [<ffffffff8108e079>] kthread+0xc9/0xd1
[ 1852.843099] [<ffffffff8109427f>] ? finish_task_switch+0x3a/0xce
[ 1852.926518] [<ffffffff8108dfb0>] ? __kthread_parkme+0x61/0x61
[ 1853.008565] [<ffffffff819cbeac>] ret_from_fork+0x7c/0xb0
[ 1853.076477] [<ffffffff8108dfb0>] ? __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 <ebiederm@xmission.com>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Dan Aloni <dan@kernelim.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
[Trond: replace uses of remove_proc_entry() with remove_proc_subtree()
as suggested by Al Viro]
Cc: stable@vger.kernel.org # 3.4.x : 65b38851a17: NFS: Fix /proc/fs/nfsfs/servers
Cc: stable@vger.kernel.org # 3.4.x
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2014-09-08 16:41:36 -07:00
..
2014-06-25 19:02:14 -04:00
2014-08-13 18:13:19 -06:00
2014-06-24 18:47:00 -04:00
2013-02-15 10:43:36 -05:00
2013-02-15 10:43:36 -05:00
2014-02-19 21:21:06 -05:00
2013-06-28 16:29:51 -04:00
2014-07-12 18:41:25 -04:00
2013-06-08 16:20:18 -04:00
2014-09-08 16:41:36 -07:00
2014-07-12 18:22:58 -04:00
2014-07-12 18:22:58 -04:00
2014-08-04 09:22:08 -04:00
2014-07-13 15:22:02 -04:00
2013-11-19 16:20:40 -05:00
2012-01-31 18:20:26 -05:00
2014-07-16 15:10:39 +02:00
2011-10-18 09:14:34 -07:00
2013-09-27 18:40:25 +01:00
2013-09-27 18:40:25 +01:00
2014-08-07 14:40:10 -04:00
2014-07-22 21:55:45 +01:00
2014-08-13 18:13:19 -06:00
2014-08-13 18:13:19 -06:00
2010-05-14 15:09:31 -04:00
2013-11-15 13:41:43 -05:00
2014-05-29 20:21:56 -04:00
2013-06-28 15:51:51 -04:00
2013-10-24 23:34:50 -04:00
2014-08-04 09:28:32 -07:00
2012-07-30 19:06:41 -04:00
2014-05-28 18:12:43 -04:00
2014-08-26 16:17:48 -04:00
2012-07-30 19:05:54 -04:00
2014-07-13 15:22:02 -04:00
2014-01-26 08:26:20 -05:00
2014-05-28 18:12:43 -04:00
2014-07-12 18:36:37 -04:00
2014-07-08 14:30:03 -04:00
2014-06-12 10:30:18 -07:00
2013-09-07 16:18:30 -04:00
2014-06-24 18:46:58 -04:00
2014-08-26 16:17:48 -04:00
2012-08-13 16:27:37 -07:00
2014-02-01 15:13:39 -05:00
2014-02-01 15:13:39 -05:00
2014-08-13 18:13:19 -06:00
2014-04-03 16:21:01 -07:00
2014-06-06 16:08:16 -07:00
2013-08-22 08:58:27 -04:00
2014-06-24 18:47:00 -04:00
2014-07-12 18:43:47 -04:00
2012-07-30 19:06:52 -04:00
2012-03-20 13:08:26 -04:00
2013-08-22 08:58:18 -04:00
2014-01-27 15:35:56 -05:00
2014-08-22 18:04:44 -04:00
2013-02-27 19:10:24 -08:00
2014-08-13 18:13:19 -06:00
2014-08-03 17:05:25 -04:00
2014-06-24 18:47:00 -04:00
2014-06-25 19:01:27 -04:00
2014-08-04 17:41:52 -04:00
2010-03-30 22:02:32 +09:00
2014-06-06 16:08:16 -07:00
2014-03-17 15:14:17 -04:00
2014-08-22 18:04:43 -04:00