From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02948C4724C for ; Fri, 1 May 2020 14:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA001206D6 for ; Fri, 1 May 2020 14:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588341600; bh=+7j9GFWXunKNP2Ttv6Fhq8oqYAqAHsbaixIo/ARYwLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ELdOt9HP6YSug3UNYAUHDvV17W+yuRjNzPhazlHbtsydHtfVGnBmstU9kl3ZFIBvm 9/wO+mt3QveV1qwWatCm66tRvv0j5HQ7qR6JgRhoNQ3CoEAfUZgB3ag7ZgYH+q0k2n jyAhgISRPN4U+jJiLxOBDrwrJZgAbdIhCegllh5M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730697AbgEAN77 (ORCPT ); Fri, 1 May 2020 09:59:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729039AbgEAN2J (ORCPT ); Fri, 1 May 2020 09:28:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BB3024956; Fri, 1 May 2020 13:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339689; bh=+7j9GFWXunKNP2Ttv6Fhq8oqYAqAHsbaixIo/ARYwLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SauzXynpors7nsmpTvYOAupugk4aIUi7JI7o7jYxYZBsNxu2hiFLYSkyXKjUvMe+6 9C6R1Y1VII38Gr9PfE8S9dZ+PE0Q6nkCnjZ2bSztePdwAHlqJAtUsisPY+fV7jTxDf X22Um5XVtDdXl1ZRwLcWf8BaMn07EQ4Zv8ESSro0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiujun Huang , Jeff Layton , Ilya Dryomov , Sasha Levin Subject: [PATCH 4.9 09/80] ceph: return ceph_mdsc_do_request() errors from __get_parent() Date: Fri, 1 May 2020 15:21:03 +0200 Message-Id: <20200501131516.255207683@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131513.810761598@linuxfoundation.org> References: <20200501131513.810761598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiujun Huang [ Upstream commit c6d50296032f0b97473eb2e274dc7cc5d0173847 ] Return the error returned by ceph_mdsc_do_request(). Otherwise, r_target_inode ends up being NULL this ends up returning ENOENT regardless of the error. Signed-off-by: Qiujun Huang Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- fs/ceph/export.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/ceph/export.c b/fs/ceph/export.c index 1780218a48f08..f8e1f31e46439 100644 --- a/fs/ceph/export.c +++ b/fs/ceph/export.c @@ -157,6 +157,11 @@ static struct dentry *__get_parent(struct super_block *sb, req->r_num_caps = 1; err = ceph_mdsc_do_request(mdsc, NULL, req); + if (err) { + ceph_mdsc_put_request(req); + return ERR_PTR(err); + } + inode = req->r_target_inode; if (inode) ihold(inode); -- 2.20.1