[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080905175536.GD3795@skl-net.de>
Date: Fri, 5 Sep 2008 19:55:36 +0200
From: Andre Noll <maan@...temlinux.org>
To: Andrew Patterson <andrew.patterson@...com>
Cc: linux-scsi@...r.kernel.org, James.Bottomley@...senPartnership.com,
linux-kernel@...r.kernel.org, viro@...iv.linux.org.uk,
axboe@...nel.dk, andmike@...ux.vnet.ibm.com, mike.miller@...com,
genanr@...phone.com, jmoyer@...hat.com
Subject: Re: [PATCH 2/6] Adjust block device size after an online resize of a disk.
On 09:36, Andrew Patterson wrote:
> 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?
I'd say no. In case someone ever does, it seems natural to do nothing
and return early.
> > > + 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.
Agreed, that should be done later in a different patchset. It just
looked a bit odd to introduce a new function returning int with none
of its callers actually caring about the return value.
Thanks
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)
Powered by blists - more mailing lists