Whamcloud - gitweb
LU-18689 osp: Unregister proc files before obd cleanup 49/57949/6
authorOleg Drokin <green@whamcloud.com>
Mon, 10 Feb 2025 17:34:44 +0000 (12:34 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 18 Feb 2025 05:04:30 +0000 (05:04 +0000)
commitd9a1691ab7191125711aaadde8d043b93879733c
tree763d98ee08d5657389f39774a6deca6ffda753f7
parenta6797aa3de956115ed466a11c07285b18a003cab
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>
lustre/osp/osp_dev.c