lkml.org 
[lkml]   [2008]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 2/6] Adjust block device size after an online resize of a disk.
    From
    Date
    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



    \
     
     \ /
      Last update: 2008-09-05 17:39    [W:0.024 / U:62.420 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site