Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when setting zfs_multihost_interval at module load #7496

Closed
hhhappe opened this issue May 3, 2018 · 0 comments · Fixed by #7521
Closed

Crash when setting zfs_multihost_interval at module load #7496

hhhappe opened this issue May 3, 2018 · 0 comments · Fixed by #7521
Milestone

Comments

@hhhappe
Copy link

hhhappe commented May 3, 2018

System information

Type Version/Name
Distribution Name CentOS
Distribution Version 7.4
Linux Kernel 3.10.0-693.21.1.el7.x86_64
Architecture x86_64
ZFS Version kmod v0.7.8-1
SPL Version kmod v0.7.8-1

Describe the problem you're observing

Crashing (NULL pointer) when loading zfs module with zfs_multihost_interval parameter.

Describe how to reproduce the problem

modprobe zfs zfs_multihost_interval=1000

Tested a few other values, with the same result.

Include any warning/errors/backtraces from the system logs

[  313.044881] ZFS: Loaded module v0.7.8-1, ZFS pool version 5000, ZFS filesystem version 5
[  344.842342] ZFS: Unloaded module v0.7.8-1
[  384.756651] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  384.765412] IP: [<ffffffff81343d9b>] __list_add+0x1b/0xc0
[  384.771454] PGD 8000001ffcb1a067 PUD 1ff8a60067 PMD 0
[  384.777215] Oops: 0000 [#1] SMP
[  384.780833] Modules linked in: zfs(POE+) dell_rbu team_mode_activebackup team iTCO_wdt iTCO_vendor_support dcdbas sb_edac edac_core intel_powerclamp coretemp intel_rapl iosf_mbi kvm_inte]
[  384.868195] CPU: 1 PID: 15734 Comm: modprobe Tainted: P           OE  ------------   3.10.0-693.21.1.el7.x86_64 #1
[  384.879746] Hardware name: Dell Inc. PowerEdge R620/0GFKVD, BIOS 2.5.4 01/22/2016
[  384.888095] task: ffff881ff27c4f10 ti: ffff881ff1f08000 task.ti: ffff881ff1f08000
[  384.896444] RIP: 0010:[<ffffffff81343d9b>]  [<ffffffff81343d9b>] __list_add+0x1b/0xc0
[  384.905190] RSP: 0018:ffff881ff1f0bc08  EFLAGS: 00010246
[  384.911115] RAX: 00000000ffffffff RBX: ffff881ff1f0bc30 RCX: 0000000000000000
[  384.919077] RDX: ffffffffc0f64788 RSI: 0000000000000000 RDI: ffff881ff1f0bc30
[  384.927038] RBP: ffff881ff1f0bc20 R08: 0000000000000000 R09: 0000000000000004
[  384.934999] R10: 000000000000000a R11: f000000000000000 R12: ffffffffc0f64788
[  384.942961] R13: 0000000000000000 R14: 00000000ffffffff R15: ffffffffc0f64788
[  384.950923] FS:  00007ff1a6a66740(0000) GS:ffff881fff000000(0000) knlGS:0000000000000000
[  384.959951] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  384.966360] CR2: 00007f3f30099000 CR3: 0000001ff8abc000 CR4: 00000000001607e0
[  384.974322] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  384.982284] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  384.990244] Call Trace:
[  384.992976]  [<ffffffff816b2d96>] __mutex_lock_slowpath+0xa6/0x1d0
[  384.999876]  [<ffffffff8106ab65>] ? __cpa_flush_range+0x25/0x30
[  385.006471]  [<ffffffff816b219f>] mutex_lock+0x1f/0x2f
[  385.012246]  [<ffffffffc0d3b807>] mmp_signal_all_threads+0x27/0xf0 [zfs]
[  385.019759]  [<ffffffffc0d3b8ee>] param_set_multihost_interval+0x1e/0x30 [zfs]
[  385.027822]  [<ffffffff810b1e37>] parse_args+0x127/0x380
[  385.033742]  [<ffffffff813521b0>] ? ddebug_proc_write+0xf0/0xf0
[  385.040350]  [<ffffffff81104170>] load_module+0x1ce0/0x2a10
[  385.046559]  [<ffffffff813521b0>] ? ddebug_proc_write+0xf0/0xf0
[  385.053165]  [<ffffffff81100a73>] ? copy_module_from_fd.isra.42+0x53/0x150
[  385.060835]  [<ffffffff81105056>] SyS_finit_module+0xa6/0xd0
[  385.067154]  [<ffffffff816c0715>] system_call_fastpath+0x1c/0x21
[  385.073853] Code: ff ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 55 48 89 e5 41 55 49 89 f5 41 54 49 89 d4 53 4c 8b 42 08 48 89 fb 49 39 f0 75 2a <4d> 8b 45 00 4d 39 c4 75 68 4c 39 e3 7
[  385.095511] RIP  [<ffffffff81343d9b>] __list_add+0x1b/0xc0
[  385.101640]  RSP <ffff881ff1f0bc08>
[  385.105529] CR2: 0000000000000000
@behlendorf behlendorf added this to the 0.8.0 milestone May 3, 2018
behlendorf pushed a commit that referenced this issue May 11, 2018
Callbacks provided for module parameters are executed both
after the module is loaded, when a user alters it via sysfs, e.g
	echo bar > /sys/modules/zfs/parameters/foo

as well as when the module is loaded with an argument, e.g.
	modprobe zfs foo=bar

In the latter case, the init functions likely have not run yet,
including spa_init() which initializes the namespace lock so it is safe
to use.

Instead of immediately taking the namespace lock and attemping to
iterate over initialized spa structures, check whether spa_mode_global
is nonzero.  This is set by spa_init() after it has initialized the
namespace lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #7496 
Closes #7521
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Aug 15, 2018
Callbacks provided for module parameters are executed both
after the module is loaded, when a user alters it via sysfs, e.g
	echo bar > /sys/modules/zfs/parameters/foo

as well as when the module is loaded with an argument, e.g.
	modprobe zfs foo=bar

In the latter case, the init functions likely have not run yet,
including spa_init() which initializes the namespace lock so it is safe
to use.

Instead of immediately taking the namespace lock and attemping to
iterate over initialized spa structures, check whether spa_mode_global
is nonzero.  This is set by spa_init() after it has initialized the
namespace lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes openzfs#7496 
Closes openzfs#7521
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Aug 23, 2018
Callbacks provided for module parameters are executed both
after the module is loaded, when a user alters it via sysfs, e.g
	echo bar > /sys/modules/zfs/parameters/foo

as well as when the module is loaded with an argument, e.g.
	modprobe zfs foo=bar

In the latter case, the init functions likely have not run yet,
including spa_init() which initializes the namespace lock so it is safe
to use.

Instead of immediately taking the namespace lock and attemping to
iterate over initialized spa structures, check whether spa_mode_global
is nonzero.  This is set by spa_init() after it has initialized the
namespace lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes openzfs#7496 
Closes openzfs#7521
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Sep 5, 2018
Callbacks provided for module parameters are executed both
after the module is loaded, when a user alters it via sysfs, e.g
	echo bar > /sys/modules/zfs/parameters/foo

as well as when the module is loaded with an argument, e.g.
	modprobe zfs foo=bar

In the latter case, the init functions likely have not run yet,
including spa_init() which initializes the namespace lock so it is safe
to use.

Instead of immediately taking the namespace lock and attemping to
iterate over initialized spa structures, check whether spa_mode_global
is nonzero.  This is set by spa_init() after it has initialized the
namespace lock.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes openzfs#7496 
Closes openzfs#7521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants