aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/exportfs/expfs.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index 1e6f556514d6..abf0a316aa1a 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -116,30 +116,23 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
116 if (IS_ERR(result)) 116 if (IS_ERR(result))
117 return result; 117 return result;
118 118
119 if (S_ISDIR(result->d_inode->i_mode) && 119 if (S_ISDIR(result->d_inode->i_mode)) {
120 (result->d_flags & DCACHE_DISCONNECTED)) { 120 if (!(result->d_flags & DCACHE_DISCONNECTED)) {
121 /* it is an unconnected directory, we must connect it */ 121 if (acceptable(context, result))
122 ; 122 return result;
123 } else {
124 if (acceptable(context, result))
125 return result;
126 if (S_ISDIR(result->d_inode->i_mode)) {
127 err = -EACCES; 123 err = -EACCES;
128 goto err_result; 124 goto err_result;
129 } 125 }
130 126
127 target_dir = dget(result);
128 } else {
129 if (acceptable(context, result))
130 return result;
131
131 alias = find_acceptable_alias(result, acceptable, context); 132 alias = find_acceptable_alias(result, acceptable, context);
132 if (alias) 133 if (alias)
133 return alias; 134 return alias;
134 }
135 135
136 /* It's a directory, or we are required to confirm the file's
137 * location in the tree based on the parent information
138 */
139 dprintk("find_exported_dentry: need to look harder for %s/%d\n",sb->s_id,*(int*)obj);
140 if (S_ISDIR(result->d_inode->i_mode))
141 target_dir = dget(result);
142 else {
143 if (parent == NULL) 136 if (parent == NULL)
144 goto err_result; 137 goto err_result;
145 138
@@ -149,6 +142,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent,
149 goto err_result; 142 goto err_result;
150 } 143 }
151 } 144 }
145
152 /* 146 /*
153 * Now we need to make sure that target_dir is properly connected. 147 * Now we need to make sure that target_dir is properly connected.
154 * It may already be, as the flag isn't always updated when connection 148 * It may already be, as the flag isn't always updated when connection