[pnfs] 答复: [PATCH] support multi-volume
Sorin Faibish
sfaibish at emc.com
Mon Aug 31 21:59:03 EDT 2009
On Mon, 31 Aug 2009 21:42:22 -0400, Hongyuan Ma <mahongyuan at nrchpc.ac.cn>
wrote:
> Hi, Fred
> I have not noticed this problem. I'll try to add 'vi_put_done' and test.
> BTW: Could you give me an example of two different devices point to the
> same
> disk?
A FS initially built on a partition of a disk/volume and later extended on
another
partition of the same disk/volume. Both use disk but on different
partitions
and there are 2 different stripes on same volume. The server will create 2
different layouts with different offsets on same volume.
>
> ==============================================================
> Hongyuan Ma
> Tel: (86)10-6260-0522
> Mailing: P. O. Box 2704# Beijing
> Postcode: 100190
> National Research Centre for High Performance Computers
> Institute of Computing Technology, Chinese Academy of Sciences
> No. 6, South Kexueyuan Road, Haidian District
> Beijing, China
>
>
> -----Original Message-----
> From: faisaman4 at gmail.com [mailto:faisaman4 at gmail.com] On Behalf Of Fred
> Isaman
> Sent: Tuesday, September 01, 2009 12:10 AM
> To: Hongyuan Ma
> Cc: Benny Halevy; pnfs at linux-nfs.org
> Subject: Re: [pnfs] 答复: [PATCH] support multi-volume
>
> 2009/8/30 Hongyuan Ma <mahongyuan at nrchpc.ac.cn>:
>> Hi,
>> I fixed multi-volume bug which I found several days ago and send this
>> bug
> to
>> the mail list.
>> The code which was cleaned up will only make the last device in sdlist
>> works, and the previous devices will be put in
>> nfs4_blk_destroy_disk_list.
>> This is why dm can't find block_device, and cause NULL pointer which I
> have
>> posted the oops...
>>
>
> Your fix causes problems if two different devices point to the same disk.
> Does the following work for you?
>
> Fred
>
> diff --git a/fs/nfs/blocklayout/blocklayout.h
> b/fs/nfs/blocklayout/blocklayout.h
> index 0111ee2..37828ac 100644
> --- a/fs/nfs/blocklayout/blocklayout.h
> +++ b/fs/nfs/blocklayout/blocklayout.h
> @@ -68,6 +68,7 @@ struct visible_block_device {
> struct list_head vi_node;
> struct block_device *vi_bdev;
> int vi_mapped;
> + int vi_put_done;
> };
>
> enum blk_vol_type {
> diff --git a/fs/nfs/blocklayout/blocklayoutdev.c
> b/fs/nfs/blocklayout/blocklayoutdev.c
> index 5d028ef..db75177 100644
> --- a/fs/nfs/blocklayout/blocklayoutdev.c
> +++ b/fs/nfs/blocklayout/blocklayoutdev.c
> @@ -91,6 +91,7 @@ static int alloc_add_disk(struct block_device
> *blk_dev, struct list_head *dlist)
> }
> vis_dev->vi_bdev = blk_dev;
> vis_dev->vi_mapped = 0;
> + vis_dev->vi_put_done = 0;
> list_add(&vis_dev->vi_node, dlist);
> return 0;
> }
> @@ -182,7 +183,7 @@ void nfs4_blk_destroy_disk_list(struct list_head
> *dlist)
> MAJOR(vis_dev->vi_bdev->bd_dev),
> MINOR(vis_dev->vi_bdev->bd_dev));
> list_del(&vis_dev->vi_node);
> - if (!vis_dev->vi_mapped)
> + if (!vis_dev->vi_put_done)
> nfs4_blkdev_put(vis_dev->vi_bdev);
> kfree(vis_dev);
> }
> @@ -385,6 +386,7 @@ static int map_sig_to_device(struct pnfs_blk_sig
> *sig,
> /* We no longer need to scan this device, and
> * we need to "put" it before creating metadevice.
> */
> + vis_dev->vi_put_done = 1;
> nfs4_blkdev_put(vis_dev->vi_bdev);
> break;
> }
>
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
--
Best Regards
Sorin Faibish
Corporate Distinguished Engineer
Network Storage Group
EMC²
where information lives
Phone: 508-435-1000 x 48545
Cellphone: 617-510-0422
Email : sfaibish at emc.com
More information about the pNFS
mailing list