• Logan Gunthorpe's avatar
    md/raid5: Add __rcu annotation to struct disk_info · b0920ede
    Logan Gunthorpe authored
    rdev and replacement are protected in some circumstances with
    rcu_dereference and synchronize_rcu (in raid5_remove_disk()). However,
    they were not annotated with __rcu so a sparse warning is emitted for
    every rcu_dereference() call.
    
    Add the __rcu annotation and fix up the initialization with
    RCU_INIT_POINTER, all pointer modifications with rcu_assign_pointer(),
    a few cases where the pointer value is tested with rcu_access_pointer()
    and one case where READ_ONCE() is used instead of rcu_dereference(),
    a case in print_raid5_conf() that should have rcu_dereference() and
    rcu_read_[un]lock() calls.
    
    Additional sparse issues will be fixed up in further commits.
    Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarSong Liu <song@kernel.org>
    b0920ede
raid5.h 29.2 KB