lockd: nlmclnt_reclaim(): avoid stack overflow
authorTim Gardner <tim.gardner@canonical.com>
Wed, 13 Feb 2013 15:40:16 +0000 (08:40 -0700)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 15 Feb 2013 16:29:38 +0000 (11:29 -0500)
Even though nlmclnt_reclaim() is only one call into the stack frame,
928 bytes on the stack seems like a lot. Recode to dynamically
allocate the request structure once from within the reclaimer task,
then pass this pointer into nlmclnt_reclaim() for reuse on
subsequent calls.

smatch analysis:

fs/lockd/clntproc.c:620 nlmclnt_reclaim() warn: 'reqst' puts
 928 bytes on stack

Also remove redundant assignment of 0 after memset.

Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

No differences found