From patchwork Sun Jul 8 21:01:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 10513353 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 9F1C36032C for ; Sun, 8 Jul 2018 21:08:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91FF1289DC for ; Sun, 8 Jul 2018 21:08:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8486C289E0; Sun, 8 Jul 2018 21:08:02 +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 4472D289DC for ; Sun, 8 Jul 2018 21:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933330AbeGHVFm (ORCPT ); Sun, 8 Jul 2018 17:05:42 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43048 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933317AbeGHVFk (ORCPT ); Sun, 8 Jul 2018 17:05:40 -0400 Received: by mail-pg1-f194.google.com with SMTP id v13-v6so844416pgr.10; Sun, 08 Jul 2018 14:05:39 -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=UFGxkFlELgjhqT2bEflX7XbN3XOBafTI2yVmVpjVghg=; b=tNE5sByRKXhDtRE1WuZ4c9Gokcs8/E8TKx2XGADQeaAeHwE5EqTJ3w3we7CsEuZZSZ iYGrWCRvuZaGAgCvUcx3bLid55hVECJ/7Bfu1HowBiHCWJp0T8N4Y4bZmNGJWi0prrF5 03A0EOL+7A3WJ6mISZ1BijPBPQgRFQ5hmxJ4Q18REVCWN1Js/QLW4PLB4fEJ2M448W23 OmVz6nvOybWyzLTaQSfGCtUk30poYbeViWsDVUQWE9mKKVLQGJpfbYAVkFMa+yl1CHsw Nem28NmzPmnDkWXPuuHkBBRn4e6+eIohOnj5Ts2cx/lBHbk580a1CJJ5Rm1dFTZPCFYt Pxfg== 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=UFGxkFlELgjhqT2bEflX7XbN3XOBafTI2yVmVpjVghg=; b=V1W8P+R3UTh3fHGxljCmY5rEq3Wc1XCffaPK9mT9n3ukh/7CvONP0h5tEMJoC53ouj VN+/8XPLzl/bBbpvdf8t2bsLATsuk/lkoP5kkbLd/6Em23cthBNAr5z8q8B1YA+Gsucs NlFTb3FcsaNEOgmOa1zgzIVPOik4u0GpiH0k600wcHgmOmW2ehPItkPPxlDH5bT1W1Ky +xhVoKx1fRNlTL+gG812yfCcdWu2JsRlIqQFCKqAzRjrfXz9lyBi/YMZAK3MS7HDZRc9 BZ0hsOd5TazaPUMJLLxqE0gSAs9sUjrx8BZCpz2c/Q2nTl2pBQhnHx75j7qrkTh+nlUT EtyA== X-Gm-Message-State: APt69E3vUJUKdTC9XFUoeFMsuvSljEVffv85XRiOPpOBcqNYP6o9fFLN 7DWVCBsS0W/Ea4hjP3hjw3Q= X-Google-Smtp-Source: AAOMgpe49X618nmvr4My1rHCeoc1jBdBdJFQlXEuW8/dWnpzP5mrHR/JQ5yLErcy43UqWCf0lSifGg== X-Received: by 2002:a62:6303:: with SMTP id x3-v6mr18710274pfb.91.1531083939531; Sun, 08 Jul 2018 14:05:39 -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.38 (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 08/18] fsmount: pass up error code from dentry_open() Date: Sun, 8 Jul 2018 14:01:44 -0700 Message-Id: <20180708210154.10423-9-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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/namespace.c b/fs/namespace.c index 6f0701a03a2b3..9cde133d0a9c4 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3333,8 +3333,10 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, unsigned int, ms_flags * it, not just simply put it. */ file = dentry_open(&newmount, O_PATH, fc->cred); - if (IS_ERR(file)) + if (IS_ERR(file)) { + ret = PTR_ERR(file); goto err_path; + } file->f_mode |= FMODE_NEED_UNMOUNT; ret = get_unused_fd_flags(flags & FSMOUNT_CLOEXEC);