Skip to content

btrfs: fix RCU string sparse noise

Omar Sandoval linux-btrfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rcustring: clean up botched __rcu annotationsinclude/linux/rcustring.h+2 -30 replies
2/3btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFOfs/btrfs/ioctl.c+5 -52 replies
3/3btrfs: refactor btrfs_device->name updatesfs/btrfs/volumes.c fs/btrfs/volumes.h+65 -302 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: fix RCU string sparse noise

Hi everyone,

These patches clean up the big stack of sparse RCU errors I introduced into the integration tree as reported by the kbuild test robot:

Quoted 10 lines · kbuild test robot
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git integration
head:   c7a37618b60026121255c69e042d74ae5631470c
commit: 37aad79d90a0cbf82a5eda62dfe3af4241f5aca3 [38/39] Move BTRFS RCU string to common library
reproduce:
  # apt-get install sparse
  git checkout 37aad79d90a0cbf82a5eda62dfe3af4241f5aca3
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__
Quoted 5 lines

sparse warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

fs/btrfs/check-integrity.c:848:25: sparse: incorrect type in argument 1 (different address spaces)

fs/btrfs/check-integrity.c:848:25: expected struct rcu_string [noderef] <asn:4>*rcu_str
fs/btrfs/check-integrity.c:848:25: got struct rcu_string *name

[snip, there's a lot of these]

As payment for my transgressions, this also clean ups the existing rcu_string usage to get rid of the preexisting noise.

The first patch fixes the __rcu annotations which I got wrong on the first go. The second fixes an incorrect use of RCU in the BTRFS_IOC_DEV_INFO ioctl. The third refactors the volume code's usage of rcu_string, fixing a questionable RCU or two in the process.

This patch series applies to Chris' integration branch.

Thanks!

Omar Sandoval (3):
rcustring: clean up botched __rcu annotations
btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO
btrfs: refactor btrfs_device->name updates

 fs/btrfs/ioctl.c          | 10 ++---
 fs/btrfs/volumes.c        | 93 ++++++++++++++++++++++++++++++++---------------
 fs/btrfs/volumes.h        |  2 +-
 include/linux/rcustring.h |  5 +--
 4 files changed, 72 insertions(+), 38 deletions(-)
Signature · 1 line
2.1.3