kernel-fxtec-pro1x/fs/dlm
Alexander Aring 13296b64a8 fs: dlm: fix configfs memory leak
[ Upstream commit 3d2825c8c6105b0f36f3ff72760799fa2e71420e ]

This patch fixes the following memory detected by kmemleak and umount
gfs2 filesystem which removed the last lockspace:

unreferenced object 0xffff9264f482f600 (size 192):
  comm "dlm_controld", pid 325, jiffies 4294690276 (age 48.136s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 6e 6f 64 65 73 00 00 00  ........nodes...
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<00000000060481d7>] make_space+0x41/0x130
    [<000000008d905d46>] configfs_mkdir+0x1a2/0x5f0
    [<00000000729502cf>] vfs_mkdir+0x155/0x210
    [<000000000369bcf1>] do_mkdirat+0x6d/0x110
    [<00000000cc478a33>] do_syscall_64+0x33/0x40
    [<00000000ce9ccf01>] entry_SYSCALL_64_after_hwframe+0x44/0xa9

The patch just remembers the "nodes" entry pointer in space as I think
it's created as subdirectory when parent "spaces" is created. In
function drop_space() we will lost the pointer reference to nds because
configfs_remove_default_groups(). However as this subdirectory is always
available when "spaces" exists it will just be freed when "spaces" will be
freed.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-30 10:38:28 +01:00
..
ast.c dlm: Don't swamp the CPU with callbacks queued during recovery 2019-02-12 19:46:58 +01:00
ast.h
config.c fs: dlm: fix configfs memory leak 2020-10-30 10:38:28 +01:00
config.h
debug_fs.c dlm: Improve a size determination in table_seq_start() 2017-08-07 11:23:09 -05:00
dir.c
dir.h
dlm_internal.h dlm: remove BUG() before panic() 2020-06-25 15:32:56 +02:00
Kconfig
lock.c dlm: memory leaks on error path in dlm_user_request() 2019-01-13 09:51:07 +01:00
lock.h
lockspace.c dlm: Fix kobject memleak 2020-08-19 08:15:02 +02:00
lockspace.h
lowcomms.c dlm: check if workqueues are NULL before flushing/destroying 2019-07-31 07:27:07 +02:00
lowcomms.h
lvb_table.h
main.c
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
member.c dlm: fix possible call to kfree() for non-initialized pointer 2019-12-13 08:51:14 +01:00
member.h
memory.c dlm: NULL check before kmem_cache_destroy is not needed 2019-12-13 08:52:07 +01:00
memory.h
midcomms.c
midcomms.h
netlink.c
plock.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
rcom.c dlm: remove dlm_send_rcom_lookup_dump 2017-10-09 09:29:31 -05:00
rcom.h dlm: remove dlm_send_rcom_lookup_dump 2017-10-09 09:29:31 -05:00
recover.c DLM: retry rcom when dlm_wait_function is timed out. 2017-09-25 12:45:21 -05:00
recover.h
recoverd.c dlm: recheck kthread_should_stop() before schedule() 2017-09-25 12:48:10 -05:00
recoverd.h
requestqueue.c
requestqueue.h
user.c dlm: fix invalid cluster name warning 2019-12-13 08:52:23 +01:00
user.h
util.c
util.h