BUG: race-cond with partition-check
From [email protected] Fri Jun 8 09:57:01 2001 >Well, among the irrelevant details you left out is the fact that >it is not > blk_size[dev->major] =3D NULL; >but > if(!dev->sizes) > blk_size[dev->major] =3D NULL; Well, this is absoloutely right, the behaviour to clear blk_size when dev->sizes is NULL looks sensible to me. But seven lines below it says -unconditionaly-: blk_size[dev->major] =3D NULL;
Ah, yes. This second assignment can just be deleted, I suppose.
check.c renamed from check.c~ +1 -2
@@ -418,11 +418,10 @@ blk_size[dev->major] =NULL ; dev->part[first_minor].nr_sects = size; -/* No Such Agen^Wdevice or no minors to use for partitions */ +/* No such device or no minors to use for partitions */ if (!size || minors ==1 )return ; - blk_size[dev->major] =NULL ;check_partition (dev,MKDEV (dev->major, first_minor),1 + first_minor);/*
[In the good old days it wasn't there. It was added in 1.3.19, don't know why, probably as a safeguard to make sure nobody used these values while they are being set up. But someone was bit by the assignment, since it is not undone if we take the return, so in 2.3.48 the assignment was moved past the return, with a conditional assignment before it. I believe you are right, and we only want the conditional assignment.]
Andries
check.c line 421
Quoted 8 lines · [email protected] writes:
check.c renamed from check.c~ +1
-1@@ -418,11 +418,10 @@ blk_size[dev->major] =NULL ; dev->part[first_minor].nr_sects = size; -/* No Such Agen^Wdevice or no minors to use for partitions */ +/* No such device or no minors to use for partitions */
Any reason why you're silently removing a good old anti-NSA joke? Conspiracy theorists may have fun with that... :-)
--Malcolm
Signature · 3 lines
Malcolm Beattie <[email protected]> Unix Systems Programmer Oxford University Computing Services