From patchwork Mon Jul 8 13:48:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168646 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp7192568ilk; Mon, 8 Jul 2019 06:49:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqydpKJMC+Evu4UNqmsSuX25djdB69e/74dFMbaTMyciN+PIK32zBdKXmy1+Edoxp48iVsWw X-Received: by 2002:a17:90a:d14b:: with SMTP id t11mr25813260pjw.79.1562593761297; Mon, 08 Jul 2019 06:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562593761; cv=none; d=google.com; s=arc-20160816; b=A8x+0xF5ZJsUV1QZSxKepYGrxOhOgNGgJyKRph3XaEtz84t+7fK4OelpQeO3jipt1U 3Lk3Uwjll0jpO0whxn/DFiHJPTjimTe6KKOPkCvYnLNUiLazpa3HjsvJNOEBTtwelMQ4 s/efp33hYlIff9nn+9x8ZZxkh/NOZz05KhgR0CHsT7qo1HPpff9FUfcjYwUrKK2lX3DH tuaMf/Y1NEtl776ghnBAtEJf7ocqtKGu1NzG7WQZUtPVQAAT8Ar8kNuUn97NtrIEHNZP nBcDm/FvnjdCjxkQGM2tP/1lF3+0/hlF/J6ponT7G7Td7CbYlczwbGn67+w7DFygWFXf KjzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qB/Ay7DdwAj7yCHC+CFtyC08jgGQCceNnXGSDlxMoo8=; b=V5RDz/O69M7r83sDOU7pw2P+zSRCmHTq+ImZFuNgRbfN8T9zEY0TAWKwnTw8O+lBD1 /dDsLhBu2ZPlKFDOJRmclaF/lIdSlorzw47YjIbBTgsJuDd8ZhpaFowB/3u7T0I5+w0O kB5BqgAwfJX3gNSTBu5QPE3nL94J4O8rY844/jKYELxgMeGvV3m3bnU+FaQIXMPX+nz+ Vm7ZBdr31mDqstHHpUAnxMb4nhRT7nSVW0Z18Dsx/g1RZW4RpqeRI+9avvIgZvjvOVVh 8DQ4G6njPpLfxmugmqoTP2lw6YHUP6uHYzuSRwd4M68DVO97T/jleFenH64t6gn4+mUp vN2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si20653289pfb.1.2019.07.08.06.49.20; Mon, 08 Jul 2019 06:49:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731480AbfGHNtT (ORCPT + 30 others); Mon, 8 Jul 2019 09:49:19 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:43821 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbfGHNtT (ORCPT ); Mon, 8 Jul 2019 09:49:19 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MJW5G-1i4CkC2B8y-00Js0c; Mon, 08 Jul 2019 15:48:24 +0200 From: Arnd Bergmann To: "Yan, Zheng" , Sage Weil , Ilya Dryomov Cc: Arnd Bergmann , David Howells , Al Viro , Jeff Layton , Luis Henriques , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: [PATCH] ceph: fix uninitialized return code Date: Mon, 8 Jul 2019 15:48:08 +0200 Message-Id: <20190708134821.587398-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:j9WuTzznNib1eqFqYiDaL4gyRPc7QzL4NZ/bydGzytMcRzEQWWK 1pfqAtiy4q5IanUhQ9tbckly/jv44kLphwurVdExoHEQsGWJ+Z4NZxg7kCC5PghpPWCo8Zb NbqHurMOI0cgLCrHaTuSvWpITh9lqB1KJXAVataxPXbQjzmwgQSYlUAatKHcX0lhBQAFMZu BBrK8kwdiMyfsMqLatOCA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:MxxQnbkvXE8=:TMJta/lJz0aLSAbBBndGLO mcIHI6ma3NwEw2ZFBeNkx+gNiu2g7Ku28dtW59kaFE+5v7q6QClShdY4dfTqsxCbJn49W6AUG EXD1G7BLeTx45pa2eB3qeT/1P/kNYacCRWfalVZC/qhNmSfFvlL+lWoYlMXu3mJPHKc7sKFa8 1bE9Av3mK2ONfwdipFvjo9FdjAR35CXkXd6wAV4o4+YuSBNDzG3gZhPY7vDui1Bib1efF4OYM kl9GUpLApjYW+h2B547FwjavClw3MqXSj3WCwnb/Jq7l5REq9jn/mDzi4qIwYthTz1Xbhs/D3 vkm5rTjp0HtalvtWo94e4jgGA4uFJM4vq4doUAtgw5XvsJ0jzRV9zDrcp/CexUMRRly3BVxhD 6UbMl1n8ocIyv1WrJD5mNxJJ1+4TerOU2O+/gLKQrtMANifkVr+HRZAFXevQrDP81f6eRxzgb Zlt1VeubJUzML8lLAN0Z6EEwH9ES+DqjyW7xqYFlpKCwIX/ABOs3tJ2bIn5Ref1YKKkQ3FmJI 1C01aAZXtM8UTbTpSgnLnU7UBv0DlbDMVUWcxobYIoZI/fCsqZ4qVRp4A1jPzsyiat5NiMjAc 0YgdAyQKd+6c6xrxxRbkgvoy6wCMzITwby1WROyLepGVGOMX+5EOO/GWtL18nnr/R8Zr05AsA a7Jti8FX4rf8PfX8Y4Po92v0Kas6bYoG0U61VYHZ9wc+Ffxy6W4ufZ4hOGesYgXp3FQbeIn1r 3NiLkvooYtr34YQrCApGaL/MI19hkqOTZpl3wA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clang points out a -Wsometimed-uninitized bug in the modified ceph_real_mount() function: fs/ceph/super.c:850:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!fsc->sb->s_root) { ^~~~~~~~~~~~~~~~ fs/ceph/super.c:885:9: note: uninitialized use occurs here return err; ^~~ fs/ceph/super.c:850:2: note: remove the 'if' if its condition is always true if (!fsc->sb->s_root) { ^~~~~~~~~~~~~~~~~~~~~~ fs/ceph/super.c:843:9: note: initialize the variable 'err' to silence this warning int err; ^ = 0 Set it to zero if the condition is false. Fixes: 108f95bfaa56 ("vfs: Convert ceph to use the new mount API") Signed-off-by: Arnd Bergmann --- fs/ceph/super.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.20.0 Reviewed-by: Jeff Layton diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 0d23903ddfa5..d663aa1286f6 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -876,6 +876,8 @@ static int ceph_real_mount(struct fs_context *fc, struct ceph_fs_client *fsc) goto out; } fsc->sb->s_root = root; + } else { + err = 0; } fc->root = dget(fsc->sb->s_root);