]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
md/raid5: Un-nest struct raid5_percpu definition
authorLogan Gunthorpe <logang@deltatee.com>
Thu, 7 Apr 2022 16:57:08 +0000 (10:57 -0600)
committerSong Liu <song@kernel.org>
Mon, 25 Apr 2022 21:00:36 +0000 (14:00 -0700)
Sparse reports many warnings of the form:
  drivers/md/raid5.c:1476:16: warning: dereference of noderef expression

This is because all struct raid5_percpu definitions get marked as
__percpu when really only the pointer in r5conf should have that
annotation.

Fix this by moving the defnition of raid5_precpu out of the definition
of struct r5conf.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/raid5.h

index 9e8486a9e4451df367b9ececb15ff34476d535b8..61bc2e1f1b4e8a9cff629c8c1bdbb16fd934eae9 100644 (file)
@@ -560,6 +560,16 @@ struct r5pending_data {
        struct bio_list bios;
 };
 
+struct raid5_percpu {
+       struct page     *spare_page; /* Used when checking P/Q in raid6 */
+       void            *scribble;  /* space for constructing buffer
+                                    * lists and performing address
+                                    * conversions
+                                    */
+       int             scribble_obj_size;
+       local_lock_t    lock;
+};
+
 struct r5conf {
        struct hlist_head       *stripe_hashtbl;
        /* only protect corresponding hash list and inactive_list */
@@ -635,15 +645,7 @@ struct r5conf {
                                            */
        int                     recovery_disabled;
        /* per cpu variables */
-       struct raid5_percpu {
-               struct page     *spare_page; /* Used when checking P/Q in raid6 */
-               void            *scribble;  /* space for constructing buffer
-                                            * lists and performing address
-                                            * conversions
-                                            */
-               int             scribble_obj_size;
-               local_lock_t    lock;
-       } __percpu *percpu;
+       struct raid5_percpu __percpu *percpu;
        int scribble_disks;
        int scribble_sectors;
        struct hlist_node node;