Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933007AbcJRCHw convert rfc822-to-8bit (ORCPT ); Mon, 17 Oct 2016 22:07:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46786 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753511AbcJRCHt (ORCPT ); Mon, 17 Oct 2016 22:07:49 -0400 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning From: "Yan, Zheng" In-Reply-To: <20161017220903.1746743-1-arnd@arndb.de> Date: Tue, 18 Oct 2016 10:07:45 +0800 Cc: Sage Weil , Ilya Dryomov , Linus Torvalds , open list , Michal Hocko , "Kirill A. Shutemov" , Andrew Morton , Nikolay Borisov , ceph-devel Content-Transfer-Encoding: 8BIT Message-Id: <30418C4B-CFA8-4809-8B18-B69DC14783A3@redhat.com> References: <20161017220342.1627073-1-arnd@arndb.de> <20161017220903.1746743-1-arnd@arndb.de> To: Arnd Bergmann X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 18 Oct 2016 02:07:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 42 > On 18 Oct 2016, at 06:08, Arnd Bergmann wrote: > > 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) > — This bug has already been fixed. Regards Yan, Zheng > 2.9.0 >