diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/dcache.c | 8 | ||||
| -rw-r--r-- | fs/lockd/svclock.c | 3 | ||||
| -rw-r--r-- | fs/namespace.c | 10 |
3 files changed, 16 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 16521a9f2038..693f95bf1cae 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
| @@ -1134,6 +1134,8 @@ positive: | |||
| 1134 | return 1; | 1134 | return 1; |
| 1135 | 1135 | ||
| 1136 | rename_retry: | 1136 | rename_retry: |
| 1137 | if (locked) | ||
| 1138 | goto again; | ||
| 1137 | locked = 1; | 1139 | locked = 1; |
| 1138 | write_seqlock(&rename_lock); | 1140 | write_seqlock(&rename_lock); |
| 1139 | goto again; | 1141 | goto again; |
| @@ -1141,7 +1143,7 @@ rename_retry: | |||
| 1141 | EXPORT_SYMBOL(have_submounts); | 1143 | EXPORT_SYMBOL(have_submounts); |
| 1142 | 1144 | ||
| 1143 | /* | 1145 | /* |
| 1144 | * Search the dentry child list for the specified parent, | 1146 | * Search the dentry child list of the specified parent, |
| 1145 | * and move any unused dentries to the end of the unused | 1147 | * and move any unused dentries to the end of the unused |
| 1146 | * list for prune_dcache(). We descend to the next level | 1148 | * list for prune_dcache(). We descend to the next level |
| 1147 | * whenever the d_subdirs list is non-empty and continue | 1149 | * whenever the d_subdirs list is non-empty and continue |
| @@ -1236,6 +1238,8 @@ out: | |||
| 1236 | rename_retry: | 1238 | rename_retry: |
| 1237 | if (found) | 1239 | if (found) |
| 1238 | return found; | 1240 | return found; |
| 1241 | if (locked) | ||
| 1242 | goto again; | ||
| 1239 | locked = 1; | 1243 | locked = 1; |
| 1240 | write_seqlock(&rename_lock); | 1244 | write_seqlock(&rename_lock); |
| 1241 | goto again; | 1245 | goto again; |
| @@ -3035,6 +3039,8 @@ resume: | |||
| 3035 | return; | 3039 | return; |
| 3036 | 3040 | ||
| 3037 | rename_retry: | 3041 | rename_retry: |
| 3042 | if (locked) | ||
| 3043 | goto again; | ||
| 3038 | locked = 1; | 3044 | locked = 1; |
| 3039 | write_seqlock(&rename_lock); | 3045 | write_seqlock(&rename_lock); |
| 3040 | goto again; | 3046 | goto again; |
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index fb1a2bedbe97..8d80c990dffd 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c | |||
| @@ -289,7 +289,6 @@ static void nlmsvc_free_block(struct kref *kref) | |||
| 289 | dprintk("lockd: freeing block %p...\n", block); | 289 | dprintk("lockd: freeing block %p...\n", block); |
| 290 | 290 | ||
| 291 | /* Remove block from file's list of blocks */ | 291 | /* Remove block from file's list of blocks */ |
| 292 | mutex_lock(&file->f_mutex); | ||
| 293 | list_del_init(&block->b_flist); | 292 | list_del_init(&block->b_flist); |
| 294 | mutex_unlock(&file->f_mutex); | 293 | mutex_unlock(&file->f_mutex); |
| 295 | 294 | ||
| @@ -303,7 +302,7 @@ static void nlmsvc_free_block(struct kref *kref) | |||
| 303 | static void nlmsvc_release_block(struct nlm_block *block) | 302 | static void nlmsvc_release_block(struct nlm_block *block) |
| 304 | { | 303 | { |
| 305 | if (block != NULL) | 304 | if (block != NULL) |
| 306 | kref_put(&block->b_count, nlmsvc_free_block); | 305 | kref_put_mutex(&block->b_count, nlmsvc_free_block, &block->b_file->f_mutex); |
| 307 | } | 306 | } |
| 308 | 307 | ||
| 309 | /* | 308 | /* |
diff --git a/fs/namespace.c b/fs/namespace.c index 4d31f73e2561..7bdf7907413f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
| @@ -1886,8 +1886,14 @@ static int do_add_mount(struct mount *newmnt, struct path *path, int mnt_flags) | |||
| 1886 | return err; | 1886 | return err; |
| 1887 | 1887 | ||
| 1888 | err = -EINVAL; | 1888 | err = -EINVAL; |
| 1889 | if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(real_mount(path->mnt))) | 1889 | if (unlikely(!check_mnt(real_mount(path->mnt)))) { |
| 1890 | goto unlock; | 1890 | /* that's acceptable only for automounts done in private ns */ |
| 1891 | if (!(mnt_flags & MNT_SHRINKABLE)) | ||
| 1892 | goto unlock; | ||
| 1893 | /* ... and for those we'd better have mountpoint still alive */ | ||
| 1894 | if (!real_mount(path->mnt)->mnt_ns) | ||
| 1895 | goto unlock; | ||
| 1896 | } | ||
| 1891 | 1897 | ||
| 1892 | /* Refuse the same filesystem on the same mount point */ | 1898 | /* Refuse the same filesystem on the same mount point */ |
| 1893 | err = -EBUSY; | 1899 | err = -EBUSY; |
