linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wengang Wang <wen.gang.wang@oracle.com>
To: linux-nfs@vger.kernel.org
Cc: greg.marsden@oracle.com, joe.jin@oracle.com
Subject: [PATCH] lockd: release memory for non-normal situation
Date: Mon, 22 Nov 2010 20:40:42 +0800	[thread overview]
Message-ID: <201011221243.oAM931FO003822@rcsinet13.oracle.com> (raw)

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.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
 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;
 
-- 
1.7.2.3


             reply	other threads:[~2010-11-22 12:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 12:40 Wengang Wang [this message]
2010-11-22 17:15 ` [PATCH] lockd: release memory for non-normal situation Chuck Lever
2010-11-22 18:44   ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201011221243.oAM931FO003822@rcsinet13.oracle.com \
    --to=wen.gang.wang@oracle.com \
    --cc=greg.marsden@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).