Bug#474698: partman-base: Inconsistent output if sector size != 512 bytes
Frans Pop <email@example.com> writes:
> On Wednesday 30 April 2008, Otavio Salvador wrote:
>> Because ramdisks cannot be opened with O_DIRECT and lastest parted
>> needs it. This has been done long time ago to avoid some sync problems
>> with disks.
> Ferenc: can fdisk open /dev/ram devices and report its sector size?
> If it can then I'd say closing #477378 was not correct. If fdisk can do it
> then shouldn't parted also be smart enough to just not use O_DIRECT when
> accessing a ramdisk?
Not using O_DIRECT has proven to be problematic in past and that's why
we moved to it. I do believe you can't compare fdisk and parted. The
two share many things but parted extend it a lot.
The requirements and constraints for one are different to the other.
>> We could hack parted to allow it for testing but it's not a "real" test.
> What makes you say that this is not a "real" test?
> Seems to me that RAID over ramdisk is sufficient abstraction from the fact
> that a ramdisk is being used that parted should do the right thing,
> especially if fdisk handles it correctly.
I thought he was suggesting to test using ramdisk only, not RAID over
ramdisk. This should indeed work and I'll test my patch on that.
> You also have not really answered the question whether the use of
> PED_SECTOR_SIZE_DEFAULT in parted_server is correct at all.
Yes and no. Many parts of parted still needs it hardcoded but many has
been fixed to deal with different sector sizes already. That's why
I'll test my patch before make it public available.
> If that is hardcoded to a value of 512 in libparted (which seems to be the
> case ), then using it whenever _existing_ devices are being read or
> modified seems fundamentally broken to me and parted_server should be using
> whatever variable has the actual sector size of the device (which in most
> cases will probably be identical to PED_SECTOR_SIZE_DEFAULT).
I've change the code locally for it and will test. I'll report back
> From my layman's perspective adding some debug code to parted_server to
> check whether that variable has sane values in all cases where we currently
> use PED_SECTOR_SIZE_DEFAULT would seem to make sense (the alternative being
> a code review of libparted). If that does not turn up anything strange
> after testing on a couple of architectures, I'd be quite comfortable with
> making a switch in partman.
Exactly what I'm going to do. Please just let me check that and I'll
report back the progress.
BTW, s390 is still being worked on...
O T A V I O S A L V A D O R
E-mail: firstname.lastname@example.org UIN: 5906116
GNU/Linux User: 239058 GPG ID: 49A5F855
Home Page: http://otavio.ossystems.com.br
"Microsoft sells you Windows ... Linux gives
you the whole house."