summaryrefslogtreecommitdiffstats
path: root/include/linux/lockd
diff options
context:
space:
mode:
authorTim Gardner <tim.gardner@canonical.com>2013-02-13 08:40:16 -0700
committerJ. Bruce Fields <bfields@redhat.com>2013-02-15 11:29:38 -0500
commitf25cc71e634edcf8a15bc60a48f2b5f3ec9fbb1d (patch)
treeb66f98dacd1c095dfded8ee673290230366dd8c8 /include/linux/lockd
parentdeb4534f4f3be7aea7d9d24c3b0d58f370cbf9ef (diff)
downloadlinux-f25cc71e634edcf8a15bc60a48f2b5f3ec9fbb1d.tar.gz
linux-f25cc71e634edcf8a15bc60a48f2b5f3ec9fbb1d.tar.bz2
linux-f25cc71e634edcf8a15bc60a48f2b5f3ec9fbb1d.zip
lockd: nlmclnt_reclaim(): avoid stack overflow
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>
Diffstat (limited to 'include/linux/lockd')
-rw-r--r--include/linux/lockd/lockd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f5a051a79273..a395f1e7998f 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -212,7 +212,8 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout)
__be32 nlmclnt_grant(const struct sockaddr *addr,
const struct nlm_lock *lock);
void nlmclnt_recovery(struct nlm_host *);
-int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
+int nlmclnt_reclaim(struct nlm_host *, struct file_lock *,
+ struct nlm_rqst *);
void nlmclnt_next_cookie(struct nlm_cookie *);
/*