Commit a519b26d authored by NeilBrown's avatar NeilBrown

md: remove suspicious size_of()

When calling bioset_create we pass the size of the front_pad as
   sizeof(mddev)
which looks suspicious as mddev is a pointer and so it looks like a
common mistake where
   sizeof(*mddev)
was intended.
The size is actually correct as we want to store a pointer in the
front padding of the bios created by the bioset, so make the intent
more explicit by using
   sizeof(mddev_t *)
Reported-by: default avatarZdenek Kabelac <zdenek.kabelac@gmail.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 768e587e
...@@ -4497,7 +4497,8 @@ int md_run(mddev_t *mddev) ...@@ -4497,7 +4497,8 @@ int md_run(mddev_t *mddev)
} }
if (mddev->bio_set == NULL) if (mddev->bio_set == NULL)
mddev->bio_set = bioset_create(BIO_POOL_SIZE, sizeof(mddev)); mddev->bio_set = bioset_create(BIO_POOL_SIZE,
sizeof(mddev_t *));
spin_lock(&pers_lock); spin_lock(&pers_lock);
pers = find_pers(mddev->level, mddev->clevel); pers = find_pers(mddev->level, mddev->clevel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment