git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
fs
/
exportfs
/
expfs.c
diff --git
a/fs/exportfs/expfs.c
b/fs/exportfs/expfs.c
index
c435e0a
..
0a6f7b0
100644
(file)
--- a/
fs/exportfs/expfs.c
+++ b/
fs/exportfs/expfs.c
@@
-1,5
+1,6
@@
#include <linux/fs.h>
#include <linux/fs.h>
+#include <linux/file.h>
#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/namei.h>
#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/namei.h>
@@
-155,11
+156,15
@@
find_exported_dentry(struct super_block *sb, void *obj, void *parent,
if (!IS_ROOT(pd)) {
/* must have found a connected parent - great */
if (!IS_ROOT(pd)) {
/* must have found a connected parent - great */
+ spin_lock(&pd->d_lock);
pd->d_flags &= ~DCACHE_DISCONNECTED;
pd->d_flags &= ~DCACHE_DISCONNECTED;
+ spin_unlock(&pd->d_lock);
noprogress = 0;
} else if (pd == sb->s_root) {
printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
noprogress = 0;
} else if (pd == sb->s_root) {
printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
+ spin_lock(&pd->d_lock);
pd->d_flags &= ~DCACHE_DISCONNECTED;
pd->d_flags &= ~DCACHE_DISCONNECTED;
+ spin_unlock(&pd->d_lock);
noprogress = 0;
} else {
/* we have hit the top of a disconnected path. Try
noprogress = 0;
} else {
/* we have hit the top of a disconnected path. Try
@@
-278,7
+283,12
@@
find_exported_dentry(struct super_block *sb, void *obj, void *parent,
/* drat - I just cannot find anything acceptable */
dput(result);
/* drat - I just cannot find anything acceptable */
dput(result);
- return ERR_PTR(-ESTALE);
+ /* It might be justifiable to return ESTALE here,
+ * but the filehandle at-least looks reasonable good
+ * and it just be a permission problem, so returning
+ * -EACCESS is safer
+ */
+ return ERR_PTR(-EACCES);
err_target:
dput(target_dir);
err_target:
dput(target_dir);
@@
-343,7
+353,7
@@
static int get_name(struct dentry *dentry, char *name,
{
struct inode *dir = dentry->d_inode;
int error;
{
struct inode *dir = dentry->d_inode;
int error;
- struct file file;
+ struct file
*
file;
struct getdents_callback buffer;
error = -ENOTDIR;
struct getdents_callback buffer;
error = -ENOTDIR;
@@
-355,11
+365,13
@@
static int get_name(struct dentry *dentry, char *name,
/*
* Open the directory ...
*/
/*
* Open the directory ...
*/
- error = open_private_file(&file, dentry, O_RDONLY);
- if (error)
+ file = dentry_open(dget(dentry), NULL, O_RDONLY);
+ error = PTR_ERR(file);
+ if (IS_ERR(file))
goto out;
goto out;
+
error = -EINVAL;
error = -EINVAL;
- if (!file
.
f_op->readdir)
+ if (!file
->
f_op->readdir)
goto out_close;
buffer.name = name;
goto out_close;
buffer.name = name;
@@
-369,7
+381,7
@@
static int get_name(struct dentry *dentry, char *name,
while (1) {
int old_seq = buffer.sequence;
while (1) {
int old_seq = buffer.sequence;
- error = vfs_readdir(
&
file, filldir_one, &buffer);
+ error = vfs_readdir(file, filldir_one, &buffer);
if (error < 0)
break;
if (error < 0)
break;
@@
-383,7
+395,7
@@
static int get_name(struct dentry *dentry, char *name,
}
out_close:
}
out_close:
-
close_private_file(&
file);
+
fput(
file);
out:
return error;
}
out:
return error;
}