linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mdadm segfault with incremental
@ 2017-10-19 11:24 Bjørnar Ness
  2017-10-23  2:12 ` NeilBrown
  0 siblings, 1 reply; 4+ messages in thread
From: Bjørnar Ness @ 2017-10-19 11:24 UTC (permalink / raw)
  To: linux-raid

While working with mdadm policy/udev to add slaves when they are
inserted, I notices
mdadm is segfaulting if it gets a blank drive and action is set to
spare or above.

Looking into the code, this segfault is caused by the following code:

Incremental.c line 965

                     st2->ss->avail_size(st2, devsize,
                                         sra->devs
                                         ? sra->devs->data_offset
                                         : INVALID_SECTORS)

avail_size in my case is super1.c avail_size1

and here the code sets:

struct mdp_superblock_1 *super = st->sb;

and later tries accessing i.e super->feature_map, where it segfaults
because in the case
of an empty drive, st2 is created in super1.c/match_metadata_desc1
where it sets:

        st->sb = NULL;

I am not entirely sure how this is supposed to work, but atleast
currently it segfaults.

-- 
Bj(/)rnar

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-25 22:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-19 11:24 mdadm segfault with incremental Bjørnar Ness
2017-10-23  2:12 ` NeilBrown
2017-10-24 10:30   ` Bjørnar Ness
2017-10-25 22:00     ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).