Re: [md PATCH 01/36] md: beginnings of bad block management.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 23 Jul 2011 01:52:22 +0900 Namhyung Kim <namhyung@xxxxxxxxx> wrote:

> NeilBrown <neilb@xxxxxxx> writes:
> 
> > This the first step in allowing md to track bad-blocks per-device so
> > that we can fail individual blocks rather than the whole device.
> >
> > This patch just adds a data structure for recording bad blocks, with
> > routines to add, remove, search the list.
> >
> > Signed-off-by: NeilBrown <neilb@xxxxxxx>
> > ---
> >
> >  drivers/md/md.c |  457 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  drivers/md/md.h |   49 ++++++
> >  2 files changed, 502 insertions(+), 4 deletions(-)
> >

> > @@ -2819,8 +2837,11 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi
> >  		return ERR_PTR(-ENOMEM);
> >  	}
> >  
> > -	md_rdev_init(rdev);
> > -	if ((err = alloc_disk_sb(rdev)))
> > +	err = md_rdev_init(rdev);
> > +	if (err)
> > +		goto abort_free;
> > +	err = alloc_disk_sb(rdev);
> > +	if (err)
> >  		goto abort_free;
> >  
> >  	err = lock_rdev(rdev, newdev, super_format == -2);
> 
> Now error path at abort_free needs to free rdev->badblocks.page
> otherwise there will be memory leaks.


Yep, I've fixed that thanks.

I'll revisit when to allocate the badblocks.page in a subsequent patch.
Then I'll push it all out to for-next and give it 48 hours for any further
review and for me to do some more testing - particularly after the locking
change.

So I hope to push all this to Linus in about 48 hours.  Any other
Reviewed-by:s (including any I might have missed) welcome before then.

Thanks,

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux