OSDN Git Service

NFS: Don't cleanup sysfs superblock entry if uninitialized
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 27 Jun 2023 10:12:11 +0000 (06:12 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 29 Jun 2023 18:25:35 +0000 (14:25 -0400)
commite901f17b0742e36c9d79885a912b666cc1deb210
tree35a3ece6c5d363c5b41027a9711c58b031677efa
parentcded49ba366220ae7009d71c5804baa01acfb860
NFS: Don't cleanup sysfs superblock entry if uninitialized

Its possible to end up in nfs_free_server() before the server's superblock
sysfs entry has been initialized, in which case calling kobject_put() will
emit a WARNING.  Check if the kobject has been initialized before cleaning
it up.

Fixes: 1c7251187dc0 ("NFS: add superblock sysfs entries")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/client.c