Josh Morris
2010-Jan-14 20:46 UTC
[zfs-discuss] Invalid zpool argument in Solaris 10 (10/09)
Hello List, I am porting a block device driver(for a PCIe NAND flash disk driver) from OpenSolaris to Solaris 10. On Solaris 10 (10/09) I''m having an issues creating a zpool with the disk. Apparently I have an ''invalid argument'' somewhere: % pfexec zpool create mypool c4d0p0 cannot create ''mypool'': invalid argument for this pool operation Is there any way to enable debug in zpool so I can discover what the invalid argument is? I do see the following IOCTLs issued to my device when trying to create the zpool: Jan 14 14:35:48 dlx-a36 pflash: [ID 896041 kern.notice] DEBUG (TMS: pflash.c pflash_ioctl ln:1254 ) DKIOCINFO supported Jan 14 14:35:48 dlx-a36 pflash: [ID 896041 kern.notice] DEBUG (TMS: pflash.c pflash_ioctl ln:1227 ) DKIOCGEXTVTOC supported by CMLB Jan 14 14:35:48 dlx-a36 pflash: [ID 896041 kern.notice] DEBUG (TMS: pflash.c pflash_ioctl ln:1254 ) DKIOCINFO supported Jan 14 14:35:48 dlx-a36 pflash: [ID 896041 kern.notice] DEBUG (TMS: pflash.c pflash_ioctl ln:1227 ) DKIOCGEXTVTOC supported by CMLB Jan 14 14:35:48 dlx-a36 pflash: [ID 896041 kern.notice] DEBUG (TMS: pflash.c pflash_ioctl ln:1254 ) DKIOCINFO supported I''ve reviewed all the DKIO structures and I can''t find anything that''s wrong in my driver. This command does work with my OpenSolaris driver and the only difference between the two drivers is the CMLB version. Any help would be greatly appreciated. Let me know if I can provide anymore information. Thank you, Josh Morris josh.morris at texmemsys.com
Mark J Musante
2010-Jan-14 21:20 UTC
[zfs-discuss] Invalid zpool argument in Solaris 10 (10/09)
On Thu, 14 Jan 2010, Josh Morris wrote:> Hello List, > > I am porting a block device driver(for a PCIe NAND flash disk driver) from > OpenSolaris to Solaris 10. On Solaris 10 (10/09) I''m having an issues > creating a zpool with the disk. Apparently I have an ''invalid argument'' > somewhere: > > % pfexec zpool create mypool c4d0p0Instead of p0, can you use format to create an s0 that takes up the whole partition? Regards, markm
Josh Morris
2010-Jan-14 21:52 UTC
[zfs-discuss] Invalid zpool argument in Solaris 10 (10/09) - Email found in subject
Hello Mark I created s0 as you suggested: partition> print Current partition table (unnamed): Total disk cylinders available: 54823 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 usr wm 3 - 54822 419.94GB (54820/0/0) 880683300 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 54822 419.97GB (54823/0/0) 880731495 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 7.84MB (1/0/0) 16065 9 alternates wm 1 - 2 15.69MB (2/0/0) 32130 I still get the ''invalid argument'': % pfexec zpool create mypool c4d0s0 cannot create ''mypool'': invalid argument for this pool operation There were a lot more IOCTLs issued this time and a few accesses with extremely large addresses: WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past the end of device! (18014398509480448 >= 880791552) WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past the end of device! (18014398509480960 >= 880791552) WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past the end of device! (18014398509480448 >= 880791552) WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past the end of device! (18014398509480960 >= 880791552) Also a CDROMREADOFFSET IOCTL was issued to the device. This seems weird since my driver returns DKC_MD for the ctype when issued DKIOCINFO. Could my driver somehow be advertising the disk as a CDROM device? Thanks, Josh On 01/14/2010 03:20 PM, Mark J Musante wrote:> On Thu, 14 Jan 2010, Josh Morris wrote: > >> Hello List, >> >> I am porting a block device driver(for a PCIe NAND flash disk driver) >> from OpenSolaris to Solaris 10. On Solaris 10 (10/09) I''m having an >> issues creating a zpool with the disk. Apparently I have an ''invalid >> argument'' somewhere: >> >> % pfexec zpool create mypool c4d0p0 > > Instead of p0, can you use format to create an s0 that takes up the > whole partition? > > > Regards, > markm >
Josh Morris
2010-Jan-14 23:40 UTC
[zfs-discuss] Invalid zpool argument in Solaris 10 (10/09)
OK. Now I see the problem. ldi_get_size() uses a few DDI properties that are exported by the driver. Specifically it looks for "NBlocks", "nblocks", "Size", and "size". CMLB version 1, which is implemented in OpenSolaris, handles creating and returning these DDI properties. Solaris 10, however, only supports CMLB version 0, which apparently does NOT create these properties for you. So ldi_get_size() is failing in my Solaris 10 driver because it can''t find any of the size properties. I''ll implement these in my driver and hopefully that fixes the zpool create issue. Thanks for the help! Josh On 01/14/2010 04:14 PM, Mark J Musante wrote:> On Thu, 14 Jan 2010, Josh Morris wrote: > >> WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past >> the end of device! (18014398509480448 >= 880791552) >> WARNING: ERROR (TMS: pflash.c pflash_strategy ln:996 ) Access past >> the end of device! (18014398509480960 >= 880791552) > > That''s interesting. One of the things that zpool create does is set > up the ZFS volume information. It writes two copies near the > beginning of the disk and two copies at the end. > > The way it knows where the end of the disk is, is through the call to > ldi_get_size(). Is there a mismatch between what the driver passes > back for the size? The number 18014398509480960 is a bit suspicious > as it is 0x3FFFFFFFFFFC00. Likewise, 18014398509480448 is > 0x3FFFFFFFFFFA00. > >> Also a CDROMREADOFFSET IOCTL was issued to the device. This seems >> weird since my driver returns DKC_MD for the ctype when issued >> DKIOCINFO. > > Yeah, that''s strange too, but zfs never issues this ioctl. It goes > through the ldi api to access devices, so that''s a layer lower than I > know about. > > > Regards, > markm >