diff options
| -rw-r--r-- | fs/namei.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index 157f3debbf98..48fc0fb8c9d1 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
| @@ -1173,6 +1173,7 @@ retry: | |||
| 1173 | BUG_ON(nd->inode != dir); | 1173 | BUG_ON(nd->inode != dir); |
| 1174 | 1174 | ||
| 1175 | mutex_lock(&dir->i_mutex); | 1175 | mutex_lock(&dir->i_mutex); |
| 1176 | l: | ||
| 1176 | dentry = d_lookup(parent, name); | 1177 | dentry = d_lookup(parent, name); |
| 1177 | if (likely(!dentry)) { | 1178 | if (likely(!dentry)) { |
| 1178 | dentry = d_alloc_and_lookup(parent, name, nd); | 1179 | dentry = d_alloc_and_lookup(parent, name, nd); |
| @@ -1193,11 +1194,11 @@ retry: | |||
| 1193 | need_reval = 0; | 1194 | need_reval = 0; |
| 1194 | status = 1; | 1195 | status = 1; |
| 1195 | } | 1196 | } |
| 1196 | mutex_unlock(&dir->i_mutex); | ||
| 1197 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) | 1197 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) |
| 1198 | status = d_revalidate(dentry, nd); | 1198 | status = d_revalidate(dentry, nd); |
| 1199 | if (unlikely(status <= 0)) { | 1199 | if (unlikely(status <= 0)) { |
| 1200 | if (status < 0) { | 1200 | if (status < 0) { |
| 1201 | mutex_unlock(&dir->i_mutex); | ||
| 1201 | dput(dentry); | 1202 | dput(dentry); |
| 1202 | return status; | 1203 | return status; |
| 1203 | } | 1204 | } |
| @@ -1205,9 +1206,10 @@ retry: | |||
| 1205 | dput(dentry); | 1206 | dput(dentry); |
| 1206 | dentry = NULL; | 1207 | dentry = NULL; |
| 1207 | need_reval = 1; | 1208 | need_reval = 1; |
| 1208 | goto retry; | 1209 | goto l; |
| 1209 | } | 1210 | } |
| 1210 | } | 1211 | } |
| 1212 | mutex_unlock(&dir->i_mutex); | ||
| 1211 | goto done; | 1213 | goto done; |
| 1212 | } | 1214 | } |
| 1213 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) | 1215 | if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) |
