public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* RedBoot FIS Directory parsing bails out early
@ 2005-08-23 22:47 Russ Dill
  2005-08-24  0:17 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Russ Dill @ 2005-08-23 22:47 UTC (permalink / raw)
  To: linux-mtd

Deleted partitions cause the FIS directory parsing to bail out early,
this is because in redboot, deleting a partition causes the first byte
in the entry to be set to 0xff. The kernel is currently looking for
0xff as an end of table marker.

This means that if you create two partitions, ie, test1 and test2, and
then delete test1, the kernel will no longer detect test1.

redboot.c should instead scan every entry in the FIS table, and throw
out any entries that begin with 0xff, ie, change the break to a
continue. The checksum check should also be changed  from a break to a
continue (even though checksums in fis tables were never implemented
anyway).

pseudo patch:

 struct fis_list *new_fl, **prev
 
 if (buf[i].name[0] == 0xff)
-       break;
+       continue;
 if (!redboot_checksum(&buf[i]))
-       break;
+       continue;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RedBoot FIS Directory parsing bails out early
  2005-08-23 22:47 RedBoot FIS Directory parsing bails out early Russ Dill
@ 2005-08-24  0:17 ` Thomas Gleixner
  2005-08-24  0:50   ` Russ Dill
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2005-08-24  0:17 UTC (permalink / raw)
  To: Russ Dill; +Cc: linux-mtd

On Tue, 2005-08-23 at 15:47 -0700, Russ Dill wrote:
> Deleted partitions cause the FIS directory parsing to bail out early,
> this is because in redboot, deleting a partition causes the first byte
> in the entry to be set to 0xff. The kernel is currently looking for
> 0xff as an end of table marker.
> 
> This means that if you create two partitions, ie, test1 and test2, and
> then delete test1, the kernel will no longer detect test1.
> 
> redboot.c should instead scan every entry in the FIS table, and throw
> out any entries that begin with 0xff, ie, change the break to a
> continue. The checksum check should also be changed  from a break to a
> continue (even though checksums in fis tables were never implemented
> anyway).
> 
> pseudo patch:
> 
>  struct fis_list *new_fl, **prev
>  
>  if (buf[i].name[0] == 0xff)
> -       break;
> +       continue;
>  if (!redboot_checksum(&buf[i]))
> -       break;
> +       continue;
> 

Care to provide a real patch ?

tglx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RedBoot FIS Directory parsing bails out early
  2005-08-24  0:17 ` Thomas Gleixner
@ 2005-08-24  0:50   ` Russ Dill
  0 siblings, 0 replies; 3+ messages in thread
From: Russ Dill @ 2005-08-24  0:50 UTC (permalink / raw)
  To: tglx; +Cc: linux-mtd

> > Deleted partitions cause the FIS directory parsing to bail out early,
> > this is because in redboot, deleting a partition causes the first byte
> > in the entry to be set to 0xff. The kernel is currently looking for
> > 0xff as an end of table marker.
> >
> > This means that if you create two partitions, ie, test1 and test2, and
> > then delete test1, the kernel will no longer detect test1.
> >
> > redboot.c should instead scan every entry in the FIS table, and throw
> > out any entries that begin with 0xff, ie, change the break to a
> > continue. The checksum check should also be changed  from a break to a
> > continue (even though checksums in fis tables were never implemented
> > anyway).
> >
> > pseudo patch:
> >
> >  struct fis_list *new_fl, **prev
> >
> >  if (buf[i].name[0] == 0xff)
> > -       break;
> > +       continue;
> >  if (!redboot_checksum(&buf[i]))
> > -       break;
> > +       continue;
> >
> 
> Care to provide a real patch ?
> 


Actually, looking at some linux boards out there, because the space
allocated to the partition table is so large (usually around 120k),
the extra space is often used for board specific stuff. It'd probably
be good to add in a:

if (buf[i].name[0] == 0xff && buf[i].name[1] == 0xff)
        break;

Sorry though, I can't generate a real patch at the moment.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-24  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-23 22:47 RedBoot FIS Directory parsing bails out early Russ Dill
2005-08-24  0:17 ` Thomas Gleixner
2005-08-24  0:50   ` Russ Dill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox