diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2006-01-18 20:43:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-18 22:20:26 -0500 |
commit | c2642ab05b855d2d3b850ddf90dbb02b1b9358ac (patch) | |
tree | 38625ce3e2d5adb2d669875a41b2698b289d8ddb | |
parent | d22749b62f3e12de26b86a200f9a5bf7afe3590e (diff) |
[PATCH] nfsd4: recovery lookup dir check
Make sure we get a directory when we look up the recovery directory.
Thanks to Christoph Hellwig for the bug report.
Based on feedback from Christoph and others, we may remove the need for this
lookup and just pass in a file descriptor from userspace instead, and/or
completely move the directory handling to userspace. For now we're just
fixing the obvious bugs.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/nfsd/nfs4recover.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 64f4af3651a1..06da7506363c 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -399,9 +399,10 @@ nfsd4_init_recdir(char *rec_dirname) | |||
399 | 399 | ||
400 | nfs4_save_user(&uid, &gid); | 400 | nfs4_save_user(&uid, &gid); |
401 | 401 | ||
402 | status = path_lookup(rec_dirname, LOOKUP_FOLLOW, &rec_dir); | 402 | status = path_lookup(rec_dirname, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, |
403 | if (status == -ENOENT) | 403 | &rec_dir); |
404 | printk("NFSD: recovery directory %s doesn't exist\n", | 404 | if (status) |
405 | printk("NFSD: unable to find recovery directory %s\n", | ||
405 | rec_dirname); | 406 | rec_dirname); |
406 | 407 | ||
407 | if (!status) | 408 | if (!status) |