Re: + aoe-properly-initialise-the-request_queues-backing_dev_info.patch added to -mm tree

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

 



On Mon, 2007-12-03 at 15:14 -0800, [email protected] wrote:

> ------------------------------------------------------
> Subject: aoe: properly initialise the request_queue's backing_dev_info
> From: Andrew Morton <[email protected]>
> 
> Cc: "Ed L. Cashin" <[email protected]>
> Cc: <[email protected]>
> Cc: Peter Zijlstra <[email protected]>

Acked-by: Peter Zijlstra <[email protected]>

> Signed-off-by: Andrew Morton <[email protected]>
> ---
> 
>  drivers/block/aoe/aoeblk.c |   26 ++++++++++++++++----------
>  1 file changed, 16 insertions(+), 10 deletions(-)
> 
> diff -puN drivers/block/aoe/aoeblk.c~aoe-properly-initialise-the-request_queues-backing_dev_info drivers/block/aoe/aoeblk.c
> --- a/drivers/block/aoe/aoeblk.c~aoe-properly-initialise-the-request_queues-backing_dev_info
> +++ a/drivers/block/aoe/aoeblk.c
> @@ -6,6 +6,7 @@
>  
>  #include <linux/hdreg.h>
>  #include <linux/blkdev.h>
> +#include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/ioctl.h>
>  #include <linux/genhd.h>
> @@ -210,25 +211,20 @@ aoeblk_gdalloc(void *vp)
>  	if (gd == NULL) {
>  		printk(KERN_ERR "aoe: cannot allocate disk structure for %ld.%ld\n",
>  			d->aoemajor, d->aoeminor);
> -		spin_lock_irqsave(&d->lock, flags);
> -		d->flags &= ~DEVFL_GDALLOC;
> -		spin_unlock_irqrestore(&d->lock, flags);
> -		return;
> +		goto err;
>  	}
>  
>  	d->bufpool = mempool_create_slab_pool(MIN_BUFS, buf_pool_cache);
>  	if (d->bufpool == NULL) {
>  		printk(KERN_ERR "aoe: cannot allocate bufpool for %ld.%ld\n",
>  			d->aoemajor, d->aoeminor);
> -		put_disk(gd);
> -		spin_lock_irqsave(&d->lock, flags);
> -		d->flags &= ~DEVFL_GDALLOC;
> -		spin_unlock_irqrestore(&d->lock, flags);
> -		return;
> +		goto err_disk;
>  	}
>  
> -	spin_lock_irqsave(&d->lock, flags);
>  	blk_queue_make_request(&d->blkq, aoeblk_make_request);
> +	if (bdi_init(&d->blkq.backing_dev_info))
> +		goto err_mempool;
> +	spin_lock_irqsave(&d->lock, flags);
>  	gd->major = AOE_MAJOR;
>  	gd->first_minor = d->sysminor * AOE_PARTITIONS;
>  	gd->fops = &aoe_bdops;
> @@ -246,6 +242,16 @@ aoeblk_gdalloc(void *vp)
>  
>  	add_disk(gd);
>  	aoedisk_add_sysfs(d);
> +	return;
> +
> +err_mempool:
> +	mempool_destroy(d->bufpool);
> +err_disk:
> +	put_disk(gd);
> +err:
> +	spin_lock_irqsave(&d->lock, flags);
> +	d->flags &= ~DEVFL_GDALLOC;
> +	spin_unlock_irqrestore(&d->lock, flags);
>  }
>  
>  void

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux