aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 14:52:40 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 14:52:40 -0300
commitaaf675f53a7176475f69595827248c8b2556ea8c (patch)
tree0cb744dec714328c9f89bf85553fb7195107e5d4 /fs/namespace.c
parenttda1004x: Lock I2C bus during firmware load (diff)
parentLinux 3.6 (diff)
downloadlinux-dev-aaf675f53a7176475f69595827248c8b2556ea8c.tar.xz
linux-dev-aaf675f53a7176475f69595827248c8b2556ea8c.zip
Merge tag 'v3.6' into staging/for_v3.7
Linux 3.6 * tag 'v3.6': (562 commits) Linux 3.6 vfs: dcache: fix deadlock in tree traversal mtdchar: fix offset overflow detection thp: avoid VM_BUG_ON page_count(page) false positives in __collapse_huge_page_copy iommu/amd: Fix wrong assumption in iommu-group specific code netdev: octeon: fix return value check in octeon_mgmt_init_phy() ALSA: snd-usb: fix next_packet_size calls for pause case inetpeer: fix token initialization qlcnic: Fix scheduling while atomic bug bnx2: Clean up remaining iounmap trivial select_parent documentation fix net: phy: smsc: Implement PHY config_init for LAN87xx smsc75xx: fix resume after device reset um: Preinclude include/linux/kern_levels.h um: Fix IPC on um netdev: pasemi: fix return value check in pasemi_mac_phy_init() team: fix return value check l2tp: fix return value check USB: Fix race condition when removing host controllers USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq ...
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c10
1 files changed, 8 insertions, 2 deletions
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)
return err;
err = -EINVAL;
- if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(real_mount(path->mnt)))
- goto unlock;
+ if (unlikely(!check_mnt(real_mount(path->mnt)))) {
+ /* that's acceptable only for automounts done in private ns */
+ if (!(mnt_flags & MNT_SHRINKABLE))
+ goto unlock;
+ /* ... and for those we'd better have mountpoint still alive */
+ if (!real_mount(path->mnt)->mnt_ns)
+ goto unlock;
+ }
/* Refuse the same filesystem on the same mount point */
err = -EBUSY;