aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c3
-rw-r--r--fs/pnode.c20
-rw-r--r--fs/pnode.h1
3 files changed, 24 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 083e3401a808..2b12b7a9455d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1333,6 +1333,9 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
1333 LIST_HEAD(tmp_list); 1333 LIST_HEAD(tmp_list);
1334 struct mount *p; 1334 struct mount *p;
1335 1335
1336 if (how & UMOUNT_PROPAGATE)
1337 propagate_mount_unlock(mnt);
1338
1336 /* Gather the mounts to umount */ 1339 /* Gather the mounts to umount */
1337 for (p = mnt; p; p = next_mnt(p, mnt)) { 1340 for (p = mnt; p; p = next_mnt(p, mnt)) {
1338 p->mnt.mnt_flags |= MNT_UMOUNT; 1341 p->mnt.mnt_flags |= MNT_UMOUNT;
diff --git a/fs/pnode.c b/fs/pnode.c
index c27ae38ee250..89890293dd0a 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -362,6 +362,26 @@ int propagate_mount_busy(struct mount *mnt, int refcnt)
362} 362}
363 363
364/* 364/*
365 * Clear MNT_LOCKED when it can be shown to be safe.
366 *
367 * mount_lock lock must be held for write
368 */
369void propagate_mount_unlock(struct mount *mnt)
370{
371 struct mount *parent = mnt->mnt_parent;
372 struct mount *m, *child;
373
374 BUG_ON(parent == mnt);
375
376 for (m = propagation_next(parent, parent); m;
377 m = propagation_next(m, parent)) {
378 child = __lookup_mnt_last(&m->mnt, mnt->mnt_mountpoint);
379 if (child)
380 child->mnt.mnt_flags &= ~MNT_LOCKED;
381 }
382}
383
384/*
365 * NOTE: unmounting 'mnt' naturally propagates to all other mounts its 385 * NOTE: unmounting 'mnt' naturally propagates to all other mounts its
366 * parent propagates to. 386 * parent propagates to.
367 */ 387 */
diff --git a/fs/pnode.h b/fs/pnode.h
index aa6d65df7204..af47d4bd7b31 100644
--- a/fs/pnode.h
+++ b/fs/pnode.h
@@ -42,6 +42,7 @@ int propagate_mnt(struct mount *, struct mountpoint *, struct mount *,
42 struct hlist_head *); 42 struct hlist_head *);
43int propagate_umount(struct list_head *); 43int propagate_umount(struct list_head *);
44int propagate_mount_busy(struct mount *, int); 44int propagate_mount_busy(struct mount *, int);
45void propagate_mount_unlock(struct mount *);
45void mnt_release_group_id(struct mount *); 46void mnt_release_group_id(struct mount *);
46int get_dominating_id(struct mount *mnt, const struct path *root); 47int get_dominating_id(struct mount *mnt, const struct path *root);
47unsigned int mnt_get_count(struct mount *mnt); 48unsigned int mnt_get_count(struct mount *mnt);