[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GPT name overflow
Re: GPT name overflow
Thu, 31 Jan 2002 06:52:47 +1100
On Wed, Jan 30, 2002 at 11:52:53AM -0700, Andreas Dilger wrote:
> Hmm, I was able (on subsequent tests) to get it to fail with "this is a long
> name which h" but not "this is a long name which ". This is with 1.5.6. I
> also tried with 1.6.0p2 with the same results. Note that the name does not
> even overflow the 36 (I think) character limit.
Both work here. (1.6.0p2)
> > How does this sound:
> > * if (geom->start + geom->end)/2 is freespace then set geom to
> > ped_geometry_intersect (geom,
> > &ped_disk_get_part_by_sector (disk, (geom->start + geom->end)/2)
> > ->geom)
> > where geom is what the user specified. Actually, a bit more
> > bureaucracy, to only move within a certain fudge-factor.
> > (That bit is already implemented)
> What about:
> if (geom->start == (geom prev)->end)
> then geom->start = (geom prev)->end + 1;
> I don't know how hard it is to do this, but you need to have access to
> the (geom prev)->end _somewhere_ in order to check if it is overlapping.
Well, libparted has free space partitions, so you can get the same
information in a different way. (that's what the get_part_by_sector
Anyway, your suggestion wouldn't allow a fudge factor. Imagine
a partition starts at 156.2, and the user types 156 (meaning 156.2).
> > one gotcha:
> > There might be two "options" that are the english and native
> > versions of the same thing. So, either we have to implement this
> > at a higher level (PITA), or the UI code should know the difference
> > between native and english words. I think we need the later anyway.
> I did this last night for the partition type (which is the one which I
> see most when doing GPT partitions == always primary). Untested patch below.
This is the "high-level" approach that I didn't like...
(low-level: one option [for anything]... don't bother asking]
> Yes, having the low-level code also handle translations would be nice.
> Maybe by keeping the translated word in the same option for display,
> and the call to command_line_get_word() only returns the english word?
> That would also simplify the resulting checks.
The checks are fairly easy already, via the str_list mess, hehe.
But only displaying the translated words is better. It's a bit
Erro: blah blah blah
> I checked the GPT code, and it does appear to set the "flags" correctly.
> Sadly, even though GPT uses 16 bytes for the UUID storage, you can only
> set a single "flag" at one time (i.e. you can't have a boot RAID partition).
> It must just not do the later comparison to display the flags.
Nope, more subtle: it's not updating the uuid, so it's not getting
written to disk. Parted always reads the partition table each
time you type "print".