stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH 3.13 18/22] dont bother with propagate_mnt() unless the target is shared
Date: Mon, 31 Mar 2014 21:08:48 -0700	[thread overview]
Message-ID: <20140401040707.692779002@linuxfoundation.org> (raw)
In-Reply-To: <20140401040703.045139933@linuxfoundation.org>

3.13-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@zeniv.linux.org.uk>

commit 0b1b901b5a98bb36943d10820efc796f7cd45ff3 upstream.

If the dest_mnt is not shared, propagate_mnt() does nothing -
there's no mounts to propagate to and thus no copies to create.
Might as well don't bother calling it in that case.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/namespace.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1653,16 +1653,14 @@ static int attach_recursive_mnt(struct m
 		err = invent_group_ids(source_mnt, true);
 		if (err)
 			goto out;
-	}
-	err = propagate_mnt(dest_mnt, dest_mp, source_mnt, &tree_list);
-	if (err)
-		goto out_cleanup_ids;
-
-	lock_mount_hash();
-
-	if (IS_MNT_SHARED(dest_mnt)) {
+		err = propagate_mnt(dest_mnt, dest_mp, source_mnt, &tree_list);
+		if (err)
+			goto out_cleanup_ids;
+		lock_mount_hash();
 		for (p = source_mnt; p; p = next_mnt(p, source_mnt))
 			set_mnt_shared(p);
+	} else {
+		lock_mount_hash();
 	}
 	if (parent_path) {
 		detach_mnt(source_mnt, parent_path);
@@ -1685,8 +1683,7 @@ static int attach_recursive_mnt(struct m
 	return 0;
 
  out_cleanup_ids:
-	if (IS_MNT_SHARED(dest_mnt))
-		cleanup_group_ids(source_mnt, NULL);
+	cleanup_group_ids(source_mnt, NULL);
  out:
 	return err;
 }



  parent reply	other threads:[~2014-04-01  4:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-01  4:08 [PATCH 3.13 00/22] 3.13.9-stable review Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 01/22] ext4: atomically set inode->i_flags in ext4_set_inode_flags() Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 02/22] rcuwalk: recheck mount_lock after mountpoint crossing attempts Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 03/22] Input: mousedev - fix race when creating mixed device Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 04/22] Input: synaptics - add manual min/max quirk Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 05/22] Input: synaptics - add manual min/max quirk for ThinkPad X240 Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 06/22] Input: cypress_ps2 - dont report as a button pads Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 07/22] xen/balloon: flush persistent kmaps in correct position Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 08/22] Revert "xen: properly account for _PAGE_NUMA during xen pte translations" Greg Kroah-Hartman
2014-04-10 10:05   ` Steven Noonan
2014-04-10 10:08     ` David Vrabel
2014-04-01  4:08 ` [PATCH 3.13 09/22] i2c: cpm: Fix build by adding of_address.h and of_irq.h Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 10/22] drm/i915: Undo gtt scratch pte unmapping again Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 11/22] x86: fix boot on uniprocessor systems Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 12/22] make prepend_name() work correctly when called with negative *buflen Greg Kroah-Hartman
2014-04-09 20:17   ` Sasha Levin
2014-04-01  4:08 ` [PATCH 3.13 13/22] net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 14/22] net: mvneta: fix usage as a module on RGMII configurations Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 15/22] random32: avoid attempt to late reseed if in the middle of seeding Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 16/22] resizable namespace.c hashes Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 17/22] keep shadowed vfsmounts together Greg Kroah-Hartman
2014-04-01  4:08 ` Greg Kroah-Hartman [this message]
2014-04-01  4:08 ` [PATCH 3.13 19/22] switch mnt_hash to hlist Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 20/22] mm: close PageTail race Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 21/22] cgroup: protect modifications to cgroup_idr with cgroup_mutex Greg Kroah-Hartman
2014-04-01  4:08 ` [PATCH 3.13 22/22] netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages Greg Kroah-Hartman
2014-04-02  0:03 ` [PATCH 3.13 00/22] 3.13.9-stable review Guenter Roeck
2014-04-03 22:45   ` Greg Kroah-Hartman
2014-04-04 13:30     ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140401040707.692779002@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).