info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-mtools] Bug: mformat does not format FAT32 correctly


From: Alain Knaff
Subject: Re: [Info-mtools] Bug: mformat does not format FAT32 correctly
Date: Mon, 24 Sep 2018 15:42:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1


On 2018-09-24 12:26, Pali Rohár wrote:
[...]
> It is correct version. I forgot that I put those messages on stdout.
> Sorry for that.
> 
> Anyway, I thought that it would be useful message for end-user that
> autodetection of parameters did not work and that some calculation was
> done. So it print parameters which it then use.
> 
> So do you think that those messages about CHS geometry should not be
> printed?

I think they should only be printed if/when an actual error occurs (...
or if mformat has been invoked with a "verbose" flag...).

It is also expected that more than one drive definition might need to be
tried, hence the idea of first "printing" error messages into a buffer,
and only actually outputting them once it is clear that *all* drive
definitions have failed.

==> so I say: ok with the messages, if it's an actual error, and if they
are handled like all the other messages (errmsg)

[...]
>> ... and that's where it should be capped, and not late in the game where 
>> other code parts may already have used the initial "too high" setting. 
>> The risk here is inconsistencies, where in some parts of the code assume 
>> a sector size bigger than 4K, and others 4K. And another risk is that it 
>> breaks those situations (2m floppies) where a bigger size than 4K _is_ 
>> acceptable.
> 
> So... where in the code it should be? I looked at the code and I thought
> that correct place for BLKSSZGET is in get_block_geom().

Yes, indeed, that would be an appropriate place.

> 
> ... Or when talking about 4K, do you mean check "Fs.sector_size > 4096"?

No, that's exactly what I *don't* want. I'd rather have a check for
used_dev.ssize <= 5
That way, if other code parts depend on used_dev.ssize, they get the
capped information too. I'd hate to end up with a disk specifying a
sector size of 16K in one place and actually using 4K in another place.

Also, 2m disks or other exotic floppy formats may have bigger "sectors"
legitimately.

> Because there are two different things, one is file system sector size
> and one block device sector size.

I'd prefer to keep them as consistent with each other as possible.

> 
> If there are devices/systems which uses "Fs.sector_size > 4096", then
> that check should not be introduced.

There are.

> 
> But I was told that such devices/systems do not exists and FAT sector
> size is maximally 4096.
> 
>> [...]
>>
>> Regards,
>>
>> Alain
>>
> 

Regards,

Alain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]