Re: [PATCH 2/6] Adjust block device size after an online resize ofa disk.

From: Andrew Patterson
Date: Fri Sep 05 2008 - 11:36:55 EST


On Fri, 2008-09-05 at 15:12 +0200, Andre Noll wrote:
> On 14:27, Andrew Patterson wrote:
> > int revalidate_disk(struct gendisk *disk)
> > {
> > + struct block_device *bdev;
> > int ret = 0;
> >
> > if (disk->fops->revalidate_disk)
> > ret = disk->fops->revalidate_disk(disk);
>
> Maybe we should return early at this point if revalidate_disk()
> failed or fops->revalidate_disk is NULL.

We won't run check_disk_size_change() if we return early here. So the
question is would anyone ever make this call if they didn't have a
revalidate_disk routine? This in not the case in the current code. I
could go either way.

>
> > + bdev = bdget_disk(disk, 0);
> > + if (!bdev)
> > + return ret;
>
> We might return success here even if bdev is NULL. OTOH, as the callers
> of revalidate_disk() do not check the return value anyway (although at
> least tapeblock_revalidate_disk() might return a negative value) it's
> probably also an option to change the return type of revalidate_disk()
> to void.
>

The revalidate_disk() wrapper tries to maintain compatibility with the
current interface. It might make sense to change it given no one
actually really seems to use the return value. I guess I am very wary
about effectively changing the interface of the lower-level
revalidate_disk() routines, at least in this particular patchset.

> Andre

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