Skip to content
Commit c479755c authored by Dai Ngo's avatar Dai Ngo Committed by Greg Kroah-Hartman
Browse files

NFSD: register/unregister of nfsd-client shrinker at nfsd startup/shutdown time

[ Upstream commit f385f7d2 ]

Currently the nfsd-client shrinker is registered and unregistered at
the time the nfsd module is loaded and unloaded. The problem with this
is the shrinker is being registered before all of the relevant fields
in nfsd_net are initialized when nfsd is started. This can lead to an
oops when memory is low and the shrinker is called while nfsd is not
running.

This patch moves the  register/unregister of nfsd-client shrinker from
module load/unload time to nfsd startup/shutdown time.

Fixes: 44df6f43

 ("NFSD: add delegation reaper to react to low memory condition")
Reported-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarDai Ngo <dai.ngo@oracle.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce606d53
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment