Skip to contentSkip to conversation

UBI Create or Update Volume

DISCUSSION BRIJESH SINGH 2 participants 2 messages Jun 17, 2009 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi Artem,
Just came across the ubi_change_vtbl_record function. If first copy is written successfully and error occurs while writing second copy, this function still returns error. And hence the creation or change in Volume becomes unsuccessful. So applications consider it failure.

But if I unmount now, (clean or unclean) the first copy will become valid and second will be called corrupted (during mount time). It's not correct. So should ubi_change_vtbl_record call flush wl and return success? Because 2nd copy(old) is unmapped till now.And should UBI go to read-only mode?

Code Snip:
Funct ubi_change_vtbl_record(){
...

for (i = 0; i < UBI_LAYOUT_VOLUME_EBS; i++) {
                 err = ubi_eba_unmap_leb(ubi, layout_vol, i);
                 if (err)
                        return err;
                      err = ubi_eba_write_leb(ubi, layout_vol, i, ubi->vtbl, 0,
                                                                 ubi->vtbl_size, UBI_LONGTERM);
                        if (err)
                          return err;

}
...
}

Thanks
Brijesh

#1 lore raw

[Very difficult to read your email due to looooooooooooonnnnnnnnnnnnnnnnnnngggggggggggggggggg lines]

Hi,

Quoted 5 lines · BRIJESH SINGH

Hi Artem,
Just came across the ubi_change_vtbl_record function. If first copy is written successfully and error occurs while writing second copy, this function still returns error. And hence the creation or change in Volume becomes unsuccessful. So applications consider it failure.

But if I unmount now, (clean or unclean) the first copy will become valid and second will be called corrupted (during mount time). It's not correct. So should ubi_change_vtbl_record call flush wl and return success? Because 2nd copy(old) is unmapped till now.And should UBI go to read-only mode?

Yes, sounds right. Would you send a patch?

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