LU-18689 osp: Unregister proc files before obd cleanup
Don't register the proc files before we are fully done initializing
either.
This fixes problems with proc/sysfs access highlighted by
recovery-small test 57 that take many forms, but
universally have osp in backtrace and either crashes in one of the
attributes or in osp_statfs
BUG: unable to handle kernel NULL pointer dereference at
0000000000000710
IP: [<
ffffffff817dfdf8>] down_read+0x28/0x50
RIP: 0010:[<
ffffffff817dfdf8>] [<
ffffffff817dfdf8>] down_read+0x28/0x50
Call Trace:
[<
ffffffffa1535378>] active_show+0x28/0x90 [osp]
[<
ffffffffa0397166>] lustre_attr_show+0x16/0x20 [obdclass]
[<
ffffffff812d728c>] sysfs_kf_seq_show+0xcc/0x1e0
[<
ffffffff812d58b3>] kernfs_seq_show+0x23/0x30
[<
ffffffff8126f0b5>] seq_read+0x135/0x470
[<
ffffffff812d643d>] kernfs_fop_read+0x11d/0x190
[<
ffffffff81245839>] vfs_read+0xb9/0x1c0
[<
ffffffff8124676f>] SyS_read+0x7f/0xf0
BUG: unable to handle kernel NULL pointer dereference at
0000000000000158
IP: [<
ffffffffa14e85b1>] osp_statfs+0x2a1/0x4e0 [osp]
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
RIP: 0010:[<
ffffffffa14e85b1>] [<
ffffffffa14e85b1>] osp_statfs+0x2a1/0x4e0 [osp]
Call Trace:
[<
ffffffffa03c53f2>] filestotal_show+0x52/0x120 [obdclass]
[<
ffffffffa0378166>] lustre_attr_show+0x16/0x20 [obdclass]
[<
ffffffff812d728c>] sysfs_kf_seq_show+0xcc/0x1e0
[<
ffffffff812d58b3>] kernfs_seq_show+0x23/0x30
[<
ffffffff8126f0b5>] seq_read+0x135/0x470
[<
ffffffff812d643d>] kernfs_fop_read+0x11d/0x190
[<
ffffffff81245839>] vfs_read+0xb9/0x1c0
[<
ffffffff8124676f>] SyS_read+0x7f/0xf0
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Change-Id: Ie0337fcecfa1afe0c6be901bd9dab9cf6847555a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57949
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>