diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-07-27 22:36:45 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2007-10-10 00:31:56 +0200 |
commit | c9b6cbe56d3ac471e6cd72a59ec9e324b3417016 (patch) | |
tree | 15d77bd55682cb34678eb6f33053efaab1f81cc5 /fs/nfsd | |
parent | knfsd: demote some printk()s to dprintk()s (diff) | |
download | linux-c9b6cbe56d3ac471e6cd72a59ec9e324b3417016.tar.xz linux-c9b6cbe56d3ac471e6cd72a59ec9e324b3417016.zip |
knfsd: nfs4 name->id mapping not correctly parsing negative downcall
Note that qword_get() returns length or -1, not an -ERROR.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Acked-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 2ccffde81b84..4c0c683ce07a 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -207,6 +207,7 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen) { struct ent ent, *res; char *buf1, *bp; + int len; int error = -EINVAL; if (buf[buflen - 1] != '\n') @@ -248,10 +249,11 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen) goto out; /* Name */ - error = qword_get(&buf, buf1, PAGE_SIZE); - if (error == -EINVAL) + error = -EINVAL; + len = qword_get(&buf, buf1, PAGE_SIZE); + if (len < 0) goto out; - if (error == -ENOENT) + if (len == 0) set_bit(CACHE_NEGATIVE, &ent.h.flags); else { if (error >= IDMAP_NAMESZ) { |