On 13:48, SandeepKsinha wrote: > Signed-off-by: Sandeep K Sinha <sandeepksinha@xxxxxxxxx> > Date: Fri May 22 13:46:56 2009 +0530 > > Protecting mddev with barriers to avoid races. > > diff --git a/drivers/md/linear.c b/drivers/md/linear.c > index 9ad6ec4..e2dbda8 100644 > --- a/drivers/md/linear.c > +++ b/drivers/md/linear.c > @@ -28,10 +28,12 @@ > static inline dev_info_t *which_dev(mddev_t *mddev, sector_t sector) > { > int lo, mid, hi; > - linear_conf_t *conf = mddev_to_conf(mddev); > + linear_conf_t *conf; > > lo = 0; > hi = mddev->raid_disks - 1; > + barrier(); > + conf = mddev_to_conf(mddev); Are you sure that a compiler barrier is sufficient here? Maybe we need smp_mb(), but I'm not familar with all the different memory barrier types that exist in the kernel. And please do not use mddev_to_conf() any more. Thanks Andre -- The only person who always got his work done by Friday was Robinson Crusoe
Attachment:
signature.asc
Description: Digital signature