From patchwork Mon Oct 17 22:08:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9380723 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 19C81600CA for ; Mon, 17 Oct 2016 22:09:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E722428A86 for ; Mon, 17 Oct 2016 22:09:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB7F028C56; Mon, 17 Oct 2016 22:09:47 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 92DD128A86 for ; Mon, 17 Oct 2016 22:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934692AbcJQWJd (ORCPT ); Mon, 17 Oct 2016 18:09:33 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:65527 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932489AbcJQWJb (ORCPT ); Mon, 17 Oct 2016 18:09:31 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue003) with ESMTPA (Nemesis) id 0MbcUz-1cCPX41Djp-00J1VH; Tue, 18 Oct 2016 00:09:07 +0200 From: Arnd Bergmann To: "Yan, Zheng" , Sage Weil , Ilya Dryomov Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Arnd Bergmann , Michal Hocko , "Kirill A. Shutemov" , Andrew Morton , Nikolay Borisov , ceph-devel@vger.kernel.org Subject: [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning Date: Tue, 18 Oct 2016 00:08:54 +0200 Message-Id: <20161017220903.1746743-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161017220342.1627073-1-arnd@arndb.de> References: <20161017220342.1627073-1-arnd@arndb.de> X-Provags-ID: V03:K0:qEJ50nbDAB/UAAVRW+WpVBufOCGeAn/dDKzaMbtBkyj0o31OO7I Hb3Jc1OihKCtE7UllD/hVjfu7evpxNFeSuce+pt/TRyR3O1y8H1jak7+H99rpF7JM1Bbupj NrJfsnn6j02rS5cbU1cyPrbUyUQzw2n3G/Lw/D5qgDv76lGfNPa4xSxzVvopxe8pkJCKTtG GNIReEqqZbjUQndmzyJig== X-UI-Out-Filterresults: notjunk:1; V01:K0:83h4ls9VO04=:t0bH6Ga7QnBjaKW72RNdvd MtfvJk9lv4SLGwT+2mooxl9y0n8snqYzESNP1YDe5j+hzgrkDHBkhMtPZGRC9rs6j0+cId+BY W8dxgMOfuYtYc6/n1ZuWb87y6EuN69263yn3nMTGnrrPKwXUzSvdemLeYpry1N67aToWoQmQc KEZyOPGugSfusjH/ryxeNWXfuRfjMtTETnppWgzPoCDZVS4hQ62LwhO9S4hOwsMT/Drbaw9lE V98bUZE5eoaVHVeX2ZI3P5hc35Zht48gs5WFDg8HlP5f5iXZRq9hsvpljdHZGiYCBlXifA9B9 O17CRf+QHQnhZ8PZzex8I4zdzJ+3zgbGJcf7IfaX0oziWfYOMGScPYHg3QdvK1AMWKaF0OKGf eVlSY00f1+aRCv9Z1ah2updZQY6/c/rcHn+jTNM7bXnAmJ7gd7ksB0a5pFuyVebCWL2r9fi3Q BnV0fev8oPDTwXLue+pRLRDwnSoEUBXA7u9Gny+XQQJ/f+zi0Tu1wVohJuXdaX19iAfMXPAIk CmBpuyPIA2m5u3hjWOcdW8omNabDpOkZHRBvYZLkAq78ISyoK5BIRvWJOvoOWpu5EjyycmLVf 2wLG3XXfvfcg0kofL+UEcot4SeECKp6MDzu4BBRRp7f67YfxEX0crUA5N7svLT1wPiQMtrCF6 e9gNQ4x/2Ik8CncQCB87O6Ulw7I8JFeLizcPt2sCsf2sdRaJjmDi6eZA5+ctHn9VsogQ= Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A recent rework removed the initialization of the local 'root' variable that is returned from ceph_real_mount: fs/ceph/super.c: In function 'ceph_mount': fs/ceph/super.c:1016:38: error: 'root' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's not obvious to me what the correct fix is, so this just returns the saved root as we did before. Fixes: ce2728aaa82b ("ceph: avoid accessing / when mounting a subpath") Signed-off-by: Arnd Bergmann Cc: "Yan, Zheng" --- fs/ceph/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index a29ffce..79a4be8 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -821,7 +821,8 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc) dout("mount start %p\n", fsc); mutex_lock(&fsc->client->mount_mutex); - if (!fsc->sb->s_root) { + root = dget(fsc->sb->s_root); + if (!root) { const char *path; err = __ceph_open_session(fsc->client, started); if (err < 0)