RCU Archive on lore.kernel.org
 help / color / Atom feed
From: madhuparnabhowmik04@gmail.com
To: clm@fb.com, josef@toxicpanda.com, paulmck@kernel.org,
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>
Subject: [PATCH] fs: btrfs: volumes.h: Annotate rcu_string with __rcu
Date: Thu,  5 Dec 2019 01:49:01 +0530
Message-ID: <20191204201901.22466-1-madhuparnabhowmik04@gmail.com> (raw)

From: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.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@joelfernandes.org>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik04@gmail.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;

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204201901.22466-1-madhuparnabhowmik04@gmail.com \
    --to=madhuparnabhowmik04@gmail.com \
    --cc=clm@fb.com \
    --cc=joel@joelfernandes.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

RCU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/rcu/0 rcu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 rcu rcu/ https://lore.kernel.org/rcu \
	public-inbox-index rcu

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git