Re: [PATCH] lockd: release memory for non-normal situation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi-

On Nov 22, 2010, at 7:40 AM, Wengang Wang wrote:

> nlmclnt_proc() is neither releasing nlm_rqst nor dropping the ref on nlm_host.
> Do the release work though I am not sure if it can really hit the situation.

Based on casual code review, the only case where this is a possibility is the "out_unlock" label in nlmclnt_lock().  Otherwise, this patch introduces a double release in other cases, doesn't it?

Is there a reproducer that can demonstrate a leak?

> Signed-off-by: Wengang Wang <wen.gang.wang@xxxxxxxxxx>
> ---
> fs/lockd/clntproc.c |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
> index 332c54c..ec9f0f5 100644
> --- a/fs/lockd/clntproc.c
> +++ b/fs/lockd/clntproc.c
> @@ -173,8 +173,10 @@ int nlmclnt_proc(struct nlm_host *host, int cmd, struct file_lock *fl)
> 			status = nlmclnt_unlock(call, fl);
> 	} else if (IS_GETLK(cmd))
> 		status = nlmclnt_test(call, fl);
> -	else
> +	else {
> +		nlm_release_call(call);
> 		status = -EINVAL;
> +	}
> 	fl->fl_ops->fl_release_private(fl);
> 	fl->fl_ops = NULL;

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux