Skip to content

Commit

Permalink
[PATCH] nfsd4: recovery lookup dir check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
J. Bruce Fields authored and Linus Torvalds committed Jan 19, 2006
1 parent d22749b commit c2642ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/nfsd/nfs4recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,10 @@ nfsd4_init_recdir(char *rec_dirname)

nfs4_save_user(&uid, &gid);

status = path_lookup(rec_dirname, LOOKUP_FOLLOW, &rec_dir);
if (status == -ENOENT)
printk("NFSD: recovery directory %s doesn't exist\n",
status = path_lookup(rec_dirname, LOOKUP_FOLLOW | LOOKUP_DIRECTORY,
&rec_dir);
if (status)
printk("NFSD: unable to find recovery directory %s\n",
rec_dirname);

if (!status)
Expand Down

0 comments on commit c2642ab

Please sign in to comment.