Skip to content

Commit

Permalink
mnt: Add MNT_UMOUNT flag
Browse files Browse the repository at this point in the history
In some instances it is necessary to know if the the unmounting
process has begun on a mount.  Add MNT_UMOUNT to make that reliably
testable.

This fix gets used in fixing locked mounts in MNT_DETACH

Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
  • Loading branch information
Eric W. Biederman committed Apr 3, 2015
1 parent c003b26 commit 590ce4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,10 @@ static void umount_tree(struct mount *mnt, enum umount_tree_flags how)
struct mount *p;

/* Gather the mounts to umount */
for (p = mnt; p; p = next_mnt(p, mnt))
for (p = mnt; p; p = next_mnt(p, mnt)) {
p->mnt.mnt_flags |= MNT_UMOUNT;
list_move(&p->mnt_list, &tmp_list);
}

/* Hide the mounts from lookup_mnt and mnt_mounts */
list_for_each_entry(p, &tmp_list, mnt_list) {
Expand Down
1 change: 1 addition & 0 deletions fs/pnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ static void __propagate_umount(struct mount *mnt)
if (child && list_empty(&child->mnt_mounts)) {
list_del_init(&child->mnt_child);
hlist_del_init_rcu(&child->mnt_hash);
child->mnt.mnt_flags |= MNT_UMOUNT;
list_move_tail(&child->mnt_list, &mnt->mnt_list);
}
}
Expand Down
1 change: 1 addition & 0 deletions include/linux/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct mnt_namespace;
#define MNT_DOOMED 0x1000000
#define MNT_SYNC_UMOUNT 0x2000000
#define MNT_MARKED 0x4000000
#define MNT_UMOUNT 0x8000000

struct vfsmount {
struct dentry *mnt_root; /* root of the mounted tree */
Expand Down

0 comments on commit 590ce4b

Please sign in to comment.