* [Drbd-dev] DRBD-8: crashes if role is changed to Secondary whilst disk state is Negotiating...
@ 2006-09-24 15:35 Graham, Simon
2006-09-25 13:48 ` Philipp Reisner
0 siblings, 1 reply; 2+ messages in thread
From: Graham, Simon @ 2006-09-24 15:35 UTC (permalink / raw)
To: drbd-dev
The specific crash I saw was due to this code in drbd_set_role; drbd_set_role calls drbd_al_to_on_disk_bm() if the new role is secondary and the disk state is not diskless -- there are transitory states between diskless and attached where this is not valid.
The specific lines of code are:
if(mdev->state.disk > Diskless && (new_role & Secondary)) {
drbd_al_to_on_disk_bm(mdev);
}
and the test should presumably be 'mdev->state.disk > Negotiating' - however, this routine presumably needs to use inc_local() to do this so I would propose the following:
if ((new_role & Secondary) && inc_local(mdev)) {
drbd_al_to_on_disk_bm(mdev);
dec_local(mdev);
}
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Drbd-dev] DRBD-8: crashes if role is changed to Secondary whilst disk state is Negotiating...
2006-09-24 15:35 [Drbd-dev] DRBD-8: crashes if role is changed to Secondary whilst disk state is Negotiating Graham, Simon
@ 2006-09-25 13:48 ` Philipp Reisner
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Reisner @ 2006-09-25 13:48 UTC (permalink / raw)
To: drbd-dev
Am Sonntag, 24. September 2006 17:35 schrieb Graham, Simon:
> The specific crash I saw was due to this code in drbd_set_role;
> drbd_set_role calls drbd_al_to_on_disk_bm() if the new role is secondary
> and the disk state is not diskless -- there are transitory states between
> diskless and attached where this is not valid.
>
> The specific lines of code are:
>
> if(mdev->state.disk > Diskless && (new_role & Secondary)) {
> drbd_al_to_on_disk_bm(mdev);
> }
>
> and the test should presumably be 'mdev->state.disk > Negotiating' -
> however, this routine presumably needs to use inc_local() to do this so I
> would propose the following:
>
> if ((new_role & Secondary) && inc_local(mdev)) {
> drbd_al_to_on_disk_bm(mdev);
>
> dec_local(mdev);
> }
>
Right.
-Phil
--
: Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Schönbrunnerstr 244, 1120 Vienna, Austria http://www.linbit.com :
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-25 13:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-24 15:35 [Drbd-dev] DRBD-8: crashes if role is changed to Secondary whilst disk state is Negotiating Graham, Simon
2006-09-25 13:48 ` Philipp Reisner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox