public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] UBI fails to initialise in kernel update marker
@ 2010-01-05 11:14 Peter Horton
  2010-01-10  9:42 ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Horton @ 2010-01-05 11:14 UTC (permalink / raw)
  To: linux-mtd

The in kernel copy of a volume's update marker is not initialised from the
volume table.

Signed-off-by: Peter Horton <zero@colonel-panic.org>

--- linux-2.6.32.orig/drivers/mtd/ubi/vtbl.c	2010-01-05 10:56:13.000000000 +0000
+++ linux-2.6.32/drivers/mtd/ubi/vtbl.c	2010-01-05 10:57:03.000000000 +0000
@@ -566,6 +566,7 @@
 		vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
 		vol->alignment = be32_to_cpu(vtbl[i].alignment);
 		vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
+		vol->upd_marker = vtbl[i].upd_marker;
 		vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
 					UBI_DYNAMIC_VOLUME : UBI_STATIC_VOLUME;
 		vol->name_len = be16_to_cpu(vtbl[i].name_len);

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

* Re: [PATCH] UBI fails to initialise in kernel update marker
  2010-01-05 11:14 [PATCH] UBI fails to initialise in kernel update marker Peter Horton
@ 2010-01-10  9:42 ` Artem Bityutskiy
  2010-01-10  9:57   ` Peter Horton
  0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2010-01-10  9:42 UTC (permalink / raw)
  To: Peter Horton; +Cc: linux-mtd

On Tue, 2010-01-05 at 11:14 +0000, Peter Horton wrote:
> The in kernel copy of a volume's update marker is not initialised from the
> volume table.
> 
> Signed-off-by: Peter Horton <zero@colonel-panic.org>
> 
> --- linux-2.6.32.orig/drivers/mtd/ubi/vtbl.c	2010-01-05 10:56:13.000000000 +0000
> +++ linux-2.6.32/drivers/mtd/ubi/vtbl.c	2010-01-05 10:57:03.000000000 +0000
> @@ -566,6 +566,7 @@
>  		vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
>  		vol->alignment = be32_to_cpu(vtbl[i].alignment);
>  		vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
> +		vol->upd_marker = vtbl[i].upd_marker;
>  		vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
>  					UBI_DYNAMIC_VOLUME : UBI_STATIC_VOLUME;
>  		vol->name_len = be16_to_cpu(vtbl[i].name_len);

Am I right that this means that whole "forbid using volume with
unfinished update" functionality has not worked properly? Or I miss
something? Looks like I should send this patch to -stable as well.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] UBI fails to initialise in kernel update marker
  2010-01-10  9:42 ` Artem Bityutskiy
@ 2010-01-10  9:57   ` Peter Horton
  2010-01-10 10:13     ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Horton @ 2010-01-10  9:57 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

On 10/01/2010 09:42, Artem Bityutskiy wrote:
> On Tue, 2010-01-05 at 11:14 +0000, Peter Horton wrote:
>> The in kernel copy of a volume's update marker is not initialised from the
>> volume table.
>>
>> Signed-off-by: Peter Horton<zero@colonel-panic.org>
>>
>> --- linux-2.6.32.orig/drivers/mtd/ubi/vtbl.c	2010-01-05 10:56:13.000000000 +0000
>> +++ linux-2.6.32/drivers/mtd/ubi/vtbl.c	2010-01-05 10:57:03.000000000 +0000
>> @@ -566,6 +566,7 @@
>>   		vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
>>   		vol->alignment = be32_to_cpu(vtbl[i].alignment);
>>   		vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
>> +		vol->upd_marker = vtbl[i].upd_marker;
>>   		vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
>>   					UBI_DYNAMIC_VOLUME : UBI_STATIC_VOLUME;
>>   		vol->name_len = be16_to_cpu(vtbl[i].name_len);
>
> Am I right that this means that whole "forbid using volume with
> unfinished update" functionality has not worked properly? Or I miss
> something? Looks like I should send this patch to -stable as well.
>

The in kernel update marker was always clear on reboot, regardless of 
the flag in the volume table. Consequently reading from the volume 
worked after a reboot even after a failed update.

P.

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

* Re: [PATCH] UBI fails to initialise in kernel update marker
  2010-01-10  9:57   ` Peter Horton
@ 2010-01-10 10:13     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2010-01-10 10:13 UTC (permalink / raw)
  To: Peter Horton; +Cc: linux-mtd

On Sun, 2010-01-10 at 09:57 +0000, Peter Horton wrote:
> On 10/01/2010 09:42, Artem Bityutskiy wrote:
> > On Tue, 2010-01-05 at 11:14 +0000, Peter Horton wrote:
> >> The in kernel copy of a volume's update marker is not initialised from the
> >> volume table.
> >>
> >> Signed-off-by: Peter Horton<zero@colonel-panic.org>
> >>
> >> --- linux-2.6.32.orig/drivers/mtd/ubi/vtbl.c	2010-01-05 10:56:13.000000000 +0000
> >> +++ linux-2.6.32/drivers/mtd/ubi/vtbl.c	2010-01-05 10:57:03.000000000 +0000
> >> @@ -566,6 +566,7 @@
> >>   		vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
> >>   		vol->alignment = be32_to_cpu(vtbl[i].alignment);
> >>   		vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
> >> +		vol->upd_marker = vtbl[i].upd_marker;
> >>   		vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
> >>   					UBI_DYNAMIC_VOLUME : UBI_STATIC_VOLUME;
> >>   		vol->name_len = be16_to_cpu(vtbl[i].name_len);
> >
> > Am I right that this means that whole "forbid using volume with
> > unfinished update" functionality has not worked properly? Or I miss
> > something? Looks like I should send this patch to -stable as well.
> >
> 
> The in kernel update marker was always clear on reboot, regardless of 
> the flag in the volume table. Consequently reading from the volume 
> worked after a reboot even after a failed update.

Oh my. This is the second patch which fixes a bad bug in the volume
update code. It seems it was not used much. I personally do not use that
functionality. The previous fix was this:
http://git.infradead.org/ubi-2.6.git/commit/6afaf8a484cbbfd2ccf58a4e5396d1f280469789

Anyway, pushed your patch to ubi-2.6.git/master tree. I'll send it to
Linus later, and to -stable. Thanks.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2010-01-10 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 11:14 [PATCH] UBI fails to initialise in kernel update marker Peter Horton
2010-01-10  9:42 ` Artem Bityutskiy
2010-01-10  9:57   ` Peter Horton
2010-01-10 10:13     ` Artem Bityutskiy

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