Linux NFS development
 help / color / mirror / Atom feed
From: Krishna Kumar <krkumar2@in.ibm.com>
To: linux-nfs@vger.kernel.org
Cc: Krishna Kumar <krkumar2@in.ibm.com>
Subject: [PATCH 2/4] nfsd: Drop reference in expkey_parse error cases
Date: Mon, 20 Oct 2008 11:44:40 +0530	[thread overview]
Message-ID: <20081020061440.17722.70281.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20081020061428.17722.68145.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

From: Krishna Kumar <krkumar2@in.ibm.com>

Drop reference to export key on error. Compile tested.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
---
 fs/nfsd/export.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -ruNp linux-2.6.27.org/fs/nfsd/export.c linux-2.6.27.new/fs/nfsd/export.c
--- linux-2.6.27.org/fs/nfsd/export.c	2008-10-20 10:47:18.000000000 +0530
+++ linux-2.6.27.new/fs/nfsd/export.c	2008-10-20 10:48:36.000000000 +0530
@@ -151,8 +151,10 @@ static int expkey_parse(struct cache_det
 
 	/* now we want a pathname, or empty meaning NEGATIVE  */
 	err = -EINVAL;
-	if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0)
+	if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) {
+		cache_put(&ek->h, &svc_expkey_cache);
 		goto out;
+	}
 	dprintk("Path seems to be <%s>\n", buf);
 	err = 0;
 	if (len == 0) {
@@ -164,8 +166,10 @@ static int expkey_parse(struct cache_det
 	} else {
 		struct nameidata nd;
 		err = path_lookup(buf, 0, &nd);
-		if (err)
+		if (err) {
+			cache_put(&ek->h, &svc_expkey_cache);
 			goto out;
+		}
 
 		dprintk("Found the path %s\n", buf);
 		key.ek_path = nd.path;

  parent reply	other threads:[~2008-10-20  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20  6:14 [PATCH 1/4] nfsd: Minor cleanup of find_stateid Krishna Kumar
     [not found] ` <20081020061428.17722.68145.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-10-20  6:14   ` Krishna Kumar [this message]
     [not found]     ` <20081020061440.17722.70281.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-10-20 20:53       ` [PATCH 2/4] nfsd: Drop reference in expkey_parse error cases J. Bruce Fields
2008-10-20 20:26   ` [PATCH 1/4] nfsd: Minor cleanup of find_stateid J. Bruce Fields

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=20081020061440.17722.70281.sendpatchset@localhost.localdomain \
    --to=krkumar2@in.ibm.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