From patchwork Fri Jun 9 00:32:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Vagin X-Patchwork-Id: 9776859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1AE360393 for ; Fri, 9 Jun 2017 00:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E400E25404 for ; Fri, 9 Jun 2017 00:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D874628575; Fri, 9 Jun 2017 00:32:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDCBF25404 for ; Fri, 9 Jun 2017 00:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbdFIAcj (ORCPT ); Thu, 8 Jun 2017 20:32:39 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:36373 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbdFIAci (ORCPT ); Thu, 8 Jun 2017 20:32:38 -0400 Received: by mail-lf0-f65.google.com with SMTP id x81so4106958lfb.3; Thu, 08 Jun 2017 17:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=jakmW1i38B9BZRZMS70N3jdVN8vR79d4TDWsoEAREOA=; b=GIh9she9GOOpptpisFax2ae+lvd0RJfp0YPu5VO6N8YmxPSfaTy4fGg0k3to+bQaAy pbw9QGe1DzPdvr9GT09iSFsS50rJjlvP9VdNog7Pm/vK8t3B2Q6XkSkNFv4tNyXF4vet pm1wU+35inm0zLxckyKjhuKdoOh+l9YjgnU6kMQXZ6x4hezMCLmwI7RQhhyIAzYA5iUt ddjeJPO+Lqjr8uy5ljGJ9954HRBvhS0dvHBON/k+vHgUacUrav/4pAIam7KEQntWZzQs iBPWvRVN94c9kHFSkp/FKKC2850eVCyzcRdiWZ1uXSKu7QNnfqq5wU2MblbT7Tx3qOdP 9GEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=jakmW1i38B9BZRZMS70N3jdVN8vR79d4TDWsoEAREOA=; b=KyFyMvrGat2ikPbnjPq+G9gWTfOnj8u05YAAj3gOl7MDHvQaArqlrAVDDCRt2nD32N tRg6GkoAkhSXxrRzOw1nv4oZUDotfZwZoo6hhf4KbUsTgvSJYUrszEg4z3v5TDl9CigF dX9plQWvqWcCpOyFN37/2rJn1AQnm7Lz95ykQzvt4HrCrJXt4D5EpLJcB/5Pyx+Aa985 k3HDq6vExQGmN6ddupS87MRB55DRm67IB5RaoohXH2MTt4T8cB3zBBl3IkrAmGhyC4sr O9Xaf3HY7RGDludrvBNE6cW2PamQltUPG+N2YXMNS1opyiXfPnejwHsMUpN8VwNu981J CN4g== X-Gm-Message-State: AODbwcDdPFEfRxw8Cpdw2ofm28/rESj7EOf7QervRNJwiFtFctJzHAvD hzNjMn5sj6HAut+5uDw= X-Received: by 10.46.71.195 with SMTP id u186mr236519lja.16.1496968356307; Thu, 08 Jun 2017 17:32:36 -0700 (PDT) Received: from laptop.sw.ru ([4.16.175.162]) by smtp.gmail.com with ESMTPSA id h85sm1371785ljh.21.2017.06.08.17.32.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 17:32:34 -0700 (PDT) From: Andrei Vagin To: Alexander Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrei Vagin Subject: [PATCH] fs: don't forget to put old mntns in mntns_install Date: Thu, 8 Jun 2017 17:32:29 -0700 Message-Id: <20170609003229.22427-1-avagin@openvz.org> X-Mailer: git-send-email 2.9.4 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes: 4f757f3cbf54 ("make sure that mntns_install() doesn't end up with referral for root") Cc: Al Viro Signed-off-by: Andrei Vagin --- fs/namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/namespace.c b/fs/namespace.c index 8bd3e4d..5a44384 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3488,6 +3488,8 @@ static int mntns_install(struct nsproxy *nsproxy, struct ns_common *ns) return err; } + put_mnt_ns(old_mnt_ns); + /* Update the pwd and root */ set_fs_pwd(fs, &root); set_fs_root(fs, &root);