Alexander, The code assumes that if prtvtoc fails for any reason, that format(1m) should write the vtoc. I am not sure how solid an assumption this is, but it seems reasonable.
What does the 'dd' command accomplish, zeroing the 1st 16 blocks of slice 0 as shown in the example below on a volume that has no vtoc? Please explain how this works. The boolean_t disk_is_unlabeled is unnecessary. The code to invoke format -d to write the label should be within the block in which disk_is_unlabeled is set. Since a disk is being labeled, please clearly comment the code and add a log message stating that the format command was used to label the disk. Thank you, William Alexander Eremin wrote: > I need review for Bug 3136 - TI fails to create VTOC on unlabeled disk > on Sparc. > > webrev : http://cr.opensolaris.org/~alhazred/3136/ > > Tests: > Usual test_ti: > # dd if=/dev/zero of=/dev/dsk/c0t3d0s0 count=16 > 16+0 records in > 16+0 records out > #./test_ti -c -x 3 -t v -d c0t3d0 > Test TI started in real mode... > Target type specified: VTOC > Config file not specified, default VTOC will be created > VTOC target prepared successfully > ERR: creating of VTOC target failed > > test_ti_static with fixed libti: > > # ./test_ti_static -c -x 3 -t v -d c0t3d0 > Test TI started in real mode... > Target type specified: VTOC > Config file not specified, default VTOC will be created > VTOC target prepared successfully > VTOC target created successfully > > > Thanks, > >
