Skip to contentSkip to conversation

UBI fails to initialise in kernel update marker

PATCH In review Peter Horton 2 participants 4 messages Jan 5, 2010 – Jan 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI fails to initialise in kernel update marker

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

drivers/mtd/ubi/vtbl.c +1 -0
@@ -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);
#1 lore raw
Quoted 8 lines · Peter Horton

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

drivers/mtd/ubi/vtbl.c line 572

Quoted 7 lines
drivers/mtd/ubi/vtbl.c +1 -0
@@ -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.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#2 lore raw
Quoted 6 lines · Artem Bityutskiy
Quoted 5 lines · Peter Horton

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

Quoted 15 lines

drivers/mtd/ubi/vtbl.c line 572

Quoted 10 lines
drivers/mtd/ubi/vtbl.c +1 -0
@@ -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.

#3 lore raw
Quoted 23 lines · Peter Horton
Quoted 6 lines · Artem Bityutskiy
Quoted 5 lines · Peter Horton

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

Quoted 15 lines

drivers/mtd/ubi/vtbl.c line 572

Quoted 10 lines
drivers/mtd/ubi/vtbl.c +1 -0
@@ -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.

Quoted 3 lines

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.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)