[Drbd-dev] DRBD-8: crashes if role is changed to Secondary whilst disk state is Negotiating...

Philipp Reisner philipp.reisner at linbit.com
Mon Sep 25 15:48:26 CEST 2006


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 :


More information about the drbd-dev mailing list