Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1502506 > unrolled thread

[PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning

Started byArnd Bergmann <arnd@arndb.de>
First post2016-10-18 00:10 +0200
Last post2016-10-18 04:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-10-18 00:10 +0200
    Re: [PATCH 07/28] ceph: avoid false positive maybe-uninitialized  warning "Yan, Zheng" <zyan@redhat.com> - 2016-10-18 04:10 +0200

#1502506 — [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning

FromArnd Bergmann <arnd@arndb.de>
Date2016-10-18 00:10 +0200
Subject[PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning
Message-ID<stogy-1lR-19@gated-at.bofh.it>
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 <arnd@arndb.de>
Cc: "Yan, Zheng" <zyan@redhat.com>
---
 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)
-- 
2.9.0

[toc] | [next] | [standalone]


#1502645 — Re: [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning

From"Yan, Zheng" <zyan@redhat.com>
Date2016-10-18 04:10 +0200
SubjectRe: [PATCH 07/28] ceph: avoid false positive maybe-uninitialized warning
Message-ID<sts0N-3Pu-1@gated-at.bofh.it>
In reply to#1502506
> On 18 Oct 2016, at 06:08, Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de>
> Cc: "Yan, Zheng" <zyan@redhat.com>
> ---
> 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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web