diff options
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/pnode.c b/fs/pnode.c index 9af0df15256e..c7221bb19801 100644 --- a/fs/pnode.c +++ b/fs/pnode.c | |||
@@ -264,12 +264,12 @@ int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp, | |||
264 | prev_src_mnt = child; | 264 | prev_src_mnt = child; |
265 | } | 265 | } |
266 | out: | 266 | out: |
267 | br_write_lock(&vfsmount_lock); | 267 | lock_mount_hash(); |
268 | while (!list_empty(&tmp_list)) { | 268 | while (!list_empty(&tmp_list)) { |
269 | child = list_first_entry(&tmp_list, struct mount, mnt_hash); | 269 | child = list_first_entry(&tmp_list, struct mount, mnt_hash); |
270 | umount_tree(child, 0); | 270 | umount_tree(child, 0); |
271 | } | 271 | } |
272 | br_write_unlock(&vfsmount_lock); | 272 | unlock_mount_hash(); |
273 | return ret; | 273 | return ret; |
274 | } | 274 | } |
275 | 275 | ||
@@ -278,8 +278,7 @@ out: | |||
278 | */ | 278 | */ |
279 | static inline int do_refcount_check(struct mount *mnt, int count) | 279 | static inline int do_refcount_check(struct mount *mnt, int count) |
280 | { | 280 | { |
281 | int mycount = mnt_get_count(mnt) - mnt->mnt_ghosts; | 281 | return mnt_get_count(mnt) > count; |
282 | return (mycount > count); | ||
283 | } | 282 | } |
284 | 283 | ||
285 | /* | 284 | /* |
@@ -311,7 +310,7 @@ int propagate_mount_busy(struct mount *mnt, int refcnt) | |||
311 | 310 | ||
312 | for (m = propagation_next(parent, parent); m; | 311 | for (m = propagation_next(parent, parent); m; |
313 | m = propagation_next(m, parent)) { | 312 | m = propagation_next(m, parent)) { |
314 | child = __lookup_mnt(&m->mnt, mnt->mnt_mountpoint, 0); | 313 | child = __lookup_mnt_last(&m->mnt, mnt->mnt_mountpoint); |
315 | if (child && list_empty(&child->mnt_mounts) && | 314 | if (child && list_empty(&child->mnt_mounts) && |
316 | (ret = do_refcount_check(child, 1))) | 315 | (ret = do_refcount_check(child, 1))) |
317 | break; | 316 | break; |
@@ -333,8 +332,8 @@ static void __propagate_umount(struct mount *mnt) | |||
333 | for (m = propagation_next(parent, parent); m; | 332 | for (m = propagation_next(parent, parent); m; |
334 | m = propagation_next(m, parent)) { | 333 | m = propagation_next(m, parent)) { |
335 | 334 | ||
336 | struct mount *child = __lookup_mnt(&m->mnt, | 335 | struct mount *child = __lookup_mnt_last(&m->mnt, |
337 | mnt->mnt_mountpoint, 0); | 336 | mnt->mnt_mountpoint); |
338 | /* | 337 | /* |
339 | * umount the child only if the child has no | 338 | * umount the child only if the child has no |
340 | * other children | 339 | * other children |