[ENBD] [gmane.network.aoe.aoetools.general] enbd and 4TB

Florian Frank florian at ffrank.net
Sat Jan 14 14:42:26 MST 2006


Peter T. Breuer schrieb:
> "Also sprach Florian Frank:"
> 
>>could enbd handle devices with 4TB size?
> 
> In principle, yes, but of course I have no way of checking!

I got my new storage system 2 days ago, so I could test for you ;)

[...]

> so the problem appears to be the "sectors" count.

Yes:

With 512 Bytes per sector, this would be 7812280320 sectors, and
7812280320 - 2^32 is the exact the size the client displays.

>>"Support for Large Block Devices" is aktiv on both systems, kernel
>>2.6.15 and enbd 2.4.32.
> 
> Well, I don't know what that means. It might mean that the internal
> size count for a device is in 4KB blocks insteatead of 512B sectors, or
> it might mean that they use a 64 bit count, still in sectors, and that
> there is a new call to set a large block device size which takes some
> kind of new unit or else is 64 bit.
> 
> Harumph. I suspect the easist thing to do is to invent a 
> ENBD_SET_SECTORS64 ioctl to accept 64 bits for starters, then worry
> about what to do in the kernel driver later.
> 
> In the enbd_base.c code, you should see
> 
>    case ENBD_SET_SECTORS:
>         err = enbd_set_size (lo, ((__u64) arg) << 9);
>         return err;
> 
> We will add another ioctl in like this:
> 
>    case ENBD_SET_SECTORS64:
>         do {
>             u64 longlongval;
> 
>             if (get_user (longlongval, (__u64 *)arg))
>                  return -EFAULT;
>             err = enbd_set_size (lo, longlongval);
>             return err;
>         } while(0);
>         return -EINVAL;
> 
> and add a new ioctl definition in enbd.h
> 
>     #define ENBD_SET_SECTORS64    _IOWR(0xab, 0x30, __u64)

The module compiles, but I get the following unresolved symbol at loading:

enbd: Unknown symbol __get_user_X

> Then I think you can modify the setdevicesize() routine in
> enbd-client.c as follows:

[...]

- return sectors;
+ return sectors64;

and I needed:

#define BLKGETSIZE64 _IOR(0x12,114,u64)

> Let me know if that works or if anything else is required.

The module doesn't load correctly, so I can't test the changes in the
userspace utilities.

Flo

-- 
    if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
	printf("Don't Panic!\n");
	exit(42);
    }
	-- Arnold Robbins in the LJ of February '95, describing RCS

Florian Frank -- http://www.ffrank.net


More information about the ENBD mailing list