From patchwork Sun Jul 8 21:01:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10513361 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 A1F52603D7 for ; Sun, 8 Jul 2018 21:08:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94020289DC for ; Sun, 8 Jul 2018 21:08:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87D0E289E0; Sun, 8 Jul 2018 21:08:33 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3AB2D289DC for ; Sun, 8 Jul 2018 21:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933501AbeGHVIS (ORCPT ); Sun, 8 Jul 2018 17:08:18 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:40564 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933241AbeGHVFl (ORCPT ); Sun, 8 Jul 2018 17:05:41 -0400 Received: by mail-pf0-f196.google.com with SMTP id z24-v6so12151717pfe.7; Sun, 08 Jul 2018 14:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TZvP7xzX2M/u7KGjTkhIerCLDk/27sw7BMl9bNxyCSE=; b=T6svWdLrvU3owQ7EoLQ2t5UWHbd5qWssqn930z6cG/74DYzdZ6DcjQ78I1XGbjMzzv EayTbuXDSFT9GybtbMnZv0J9Mex3DPtR5Mq2yMxZnK/I0szFXxTu0HLmyzx96zpS7seM ksec9i46UTEtC0R3C66DRlhraLM/1/5xJAoVuN+YN99fwsnfL094LE4TJVnPmL2slr4t s+qdfJGhTrN28vHnWUyKt4wSorpPudkVv79Anpf2Tgxb6RjDc1oza+BChX1jN/7v+PNi rnkOhVLZKo6PwkG4QXBzYDnGvZIC01xyeYrF+i8CvMq3XuDlJhB/NJPOrkcJ1FIQFob4 rNIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TZvP7xzX2M/u7KGjTkhIerCLDk/27sw7BMl9bNxyCSE=; b=ftW/AONbR6M1eQt1zpkO8Hy6ryijizFy4U42E69weYyFDqD4bgDzYKzQ3DRhVkFITx W23Os5ROTNDtnzKseQpdfAlUK7lfxLmf+XPAzQDD1/i1UoWuqPnxF+WT8S23wSS5GMu5 ZITVScrVhIfG8e44uvCBEjdfV7zgJVTK7mqzxFf5MYhCDW8L5fg927UAIjIG6HvtAbLe n28O+/xy302aHe06lWhKAPG/t2CJ6E7aCSdVRAOlbZAxZKzV6j10QfCwOCkInAwSyO+v ryf7HjFSCmL9FtFpjOLwmlZgkCjjerntr0tRTfp/myjc6Y59YeLuA44ikM+pPH+Nc5bR Ol9Q== X-Gm-Message-State: APt69E2ezqrobEnd2rVY6BoyQUmVejFDitnI1AOyffEe7mRWTxCsEtjl H41XaSYb6Dy0SgtMSM4zXWk= X-Google-Smtp-Source: AAOMgpetxmg59rezQwTpuEFxSlYsoHwPg1/t830rJw6YBJXaAHC8aqHsqCRj31OtMzk+aTsvzrsJyA== X-Received: by 2002:a62:2541:: with SMTP id l62-v6mr18812910pfl.0.1531083940365; Sun, 08 Jul 2018 14:05:40 -0700 (PDT) Received: from sol.localdomain (c-67-185-97-198.hsd1.wa.comcast.net. [67.185.97.198]) by smtp.gmail.com with ESMTPSA id x68-v6sm23355681pfb.138.2018.07.08.14.05.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jul 2018 14:05:39 -0700 (PDT) From: Eric Biggers To: David Howells , Alexander Viro , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Eric Biggers Subject: [PATCH 09/18] fsmount: fix handling FSMOUNT_CLOEXEC Date: Sun, 8 Jul 2018 14:01:45 -0700 Message-Id: <20180708210154.10423-10-ebiggers3@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180708210154.10423-1-ebiggers3@gmail.com> References: <20180708210154.10423-1-ebiggers3@gmail.com> 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 From: Eric Biggers Fixes: 0c65353ab9f5 ("vfs: Implement fsmount() to effect a pre-configured mount") Signed-off-by: Eric Biggers --- fs/namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index 9cde133d0a9c4..8ac9e8fb31c9f 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3339,7 +3339,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, unsigned int, ms_flags } file->f_mode |= FMODE_NEED_UNMOUNT; - ret = get_unused_fd_flags(flags & FSMOUNT_CLOEXEC); + ret = get_unused_fd_flags((flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0); if (ret >= 0) fd_install(ret, file); else