lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu,  5 Dec 2019 01:49:01 +0530
From:   madhuparnabhowmik04@...il.com
To:     clm@...com, josef@...icpanda.com, paulmck@...nel.org,
        joel@...lfernandes.org
Cc:     linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
        rcu@...r.kernel.org,
        linux-kernel-mentees@...ts.linuxfoundation.org,
        Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
Subject: [PATCH] fs: btrfs: volumes.h: Annotate rcu_string with __rcu

From: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>

This patch fixes the following sparse errors in
fs/btrfs/super.c in function btrfs_show_devname()

fs/btrfs/super.c: error: incompatible types in comparison expression (different address spaces):
fs/btrfs/super.c:    struct rcu_string [noderef] <asn:4> *
fs/btrfs/super.c:    struct rcu_string *

The error was because of the following line in function btrfs_show_devname():

if (first_dev)
       seq_escape(m, rcu_str_deref(first_dev->name), " \t\n\\");

rcu_str_deref is defined in fs/btrfs/rcu-string.h

And first_dev is of type struct btrfs_device.

struct btrfs_device is defined in fs/btrfs/volumes.h

Annotating the member  "struct rcu_string *name "  of struct btrfs_device
with __rcu fixes the sparse error.

Acked-by: Joel Fernandes (Google) <joel@...lfernandes.org>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@...il.com>
---
 fs/btrfs/volumes.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index a7da1f3e3627..de7131ee604d 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -64,7 +64,7 @@ struct btrfs_device {
 	struct btrfs_fs_devices *fs_devices;
 	struct btrfs_fs_info *fs_info;
 
-	struct rcu_string *name;
+	struct rcu_string __rcu *name;
 
 	u64 generation;
 
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ