]> git.baikalelectronics.ru Git - kernel.git/commit
LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 5 Aug 2013 16:06:12 +0000 (12:06 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 5 Aug 2013 19:03:46 +0000 (15:03 -0400)
commite42791b3a6d81ccb60968523f23464a2320f3470
treed0ae011473af73d2a8789b0fb557a8ab52db7aed
parentd33c3cb0da597300ed26282fd9cb264be06085c0
LOCKD: Don't call utsname()->nodename from nlmclnt_setlockargs

Firstly, nlmclnt_setlockargs can be called from a reclaimer thread, in
which case we're in entirely the wrong namespace.

Secondly, commit c450804bb060fbe0978ceb1a074c6f2eae9ef2e0 (move
exit_task_namespaces() outside of exit_notify()) now means that
exit_task_work() is called after exit_task_namespaces(), which
triggers an Oops when we're freeing up the locks.

Fix this by ensuring that we initialise the nlm_host's rpc_client at mount
time, so that the cl_nodename field is initialised to the value of
utsname()->nodename that the net namespace uses. Then replace the
lockd callers of utsname()->nodename.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Toralf Förster <toralf.foerster@gmx.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Nix <nix@esperi.org.uk>
Cc: Jeff Layton <jlayton@redhat.com>
Cc: stable@vger.kernel.org # 3.10.x
fs/lockd/clntlock.c
fs/lockd/clntproc.c