mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
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>
This commit is contained in:
committed by
J. Bruce Fields
parent
deb4534f4f
commit
f25cc71e63
@@ -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 *);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user