Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117193
b: refs/heads/master
c: 30bc4df
h: refs/heads/master
i:
  117191: a142f06
v: v3
  • Loading branch information
J. Bruce Fields committed Oct 22, 2008
1 parent 301764b commit 0283491
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dfcde98a299196f13dd66417663a819f0ac4156
refs/heads/master: 30bc4dfd3b64eb1fbefe2c63e30d8fc129273e20
25 changes: 11 additions & 14 deletions trunk/fs/nfsd/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
int fsidtype;
char *ep;
struct svc_expkey key;
struct svc_expkey *ek;
struct svc_expkey *ek = NULL;

if (mesg[mlen-1] != '\n')
return -EINVAL;
mesg[mlen-1] = 0;

buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
err = -ENOMEM;
if (!buf) goto out;
if (!buf)
goto out;

err = -EINVAL;
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
Expand Down Expand Up @@ -151,38 +152,34 @@ static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)

/* now we want a pathname, or empty meaning NEGATIVE */
err = -EINVAL;
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0) {
cache_put(&ek->h, &svc_expkey_cache);
len = qword_get(&mesg, buf, PAGE_SIZE);
if (len < 0)
goto out;
}
dprintk("Path seems to be <%s>\n", buf);
err = 0;
if (len == 0) {
set_bit(CACHE_NEGATIVE, &key.h.flags);
ek = svc_expkey_update(&key, ek);
if (ek)
cache_put(&ek->h, &svc_expkey_cache);
else err = -ENOMEM;
if (!ek)
err = -ENOMEM;
} else {
struct nameidata nd;
err = path_lookup(buf, 0, &nd);
if (err) {
cache_put(&ek->h, &svc_expkey_cache);
if (err)
goto out;
}

dprintk("Found the path %s\n", buf);
key.ek_path = nd.path;

ek = svc_expkey_update(&key, ek);
if (ek)
cache_put(&ek->h, &svc_expkey_cache);
else
if (!ek)
err = -ENOMEM;
path_put(&nd.path);
}
cache_flush();
out:
if (ek)
cache_put(&ek->h, &svc_expkey_cache);
if (dom)
auth_domain_put(dom);
kfree(buf);
Expand Down

0 comments on commit 0283491

Please sign in to comment.