On Fri, Apr 17, 2015 at 12:06 AM, <jean-christophe.gillet@schneider-electric.com> wrote:

Hello Charles,

Thank you for your answer.
Just to be sure. Are you talking about flags skip_checkpt_rd and skip_checkpt_wr

Yes, that is correct.
You need to either use skip_checkpt_wr when unmounting before the change or skip_checkpt_rd when mounting after the change.


Do you think this sequence is correct for resizing up ?
for the new partition size

1/  create yaffs device structure with  skip_checkpt_rd=1 and  skip_checkpt_wr=1 and mount partition

Just skip_checkptr_wr is enough here.
 
At this point you will need to make some change to invalidate any existing checkpoint. For example, create and delete a 0 byte file.
yaffs_open("/mntpoint/junk_file", O_RDWR | O_CREAT, 0666);
yaffs_unlink("/mntpoint/junk_file");
 

2/ unmount partition and delete yaffs device structure
3/ same as 1 but without skipping checkpoint

You could alternatively do skip_checkpt_rd here
 

4/ yaffs_sync on partition to have checkpoint saved

I tested with verbose messages (YAFF_TRACE_VERIFY, YAFFS_TRACE_CHECKPOINT and YAFFS_TRACE_ALWAYS) and I didn't find strange messages

Best regards
Jean-Christophe

_____________________________________________________________________________________
 

Jean-Christophe GILLET
  |   Schneider Electric   |  Industry Business - Process Automation R&D  |   Firmware Engineer
Phone:
 +33 (0)4 92 13 3780 or 543780
Email:
 jean-christophe.gillet@schneider-electric.com  |   Site: www.schneider-electric.com  |   Address: 8ème Rue, ZI de Carros BP 147, 06516 Carros Cedex - France
*** Please consider the environment before printing this e-mail
 


Inactive hide details for Charles Manning ---15/04/2015 09:11:47---Hello Jean-Christophe On Tue, Apr 14, 2015 at 8:36 PM, <Charles Manning ---15/04/2015 09:11:47---Hello Jean-Christophe On Tue, Apr 14, 2015 at 8:36 PM, <

De : Charles Manning <cdhmanning@gmail.com>
A : Jean-Christophe Gillet/Aut/Schneider@Europe,
Cc : YAFFS ML <yaffs@lists.aleph1.co.uk>
Date : 15/04/2015 09:11
Objet : Re: [Yaffs] yaffs2 - resize up





Hello Jean-Christophe


On Tue, Apr 14, 2015 at 8:36 PM, <jean-christophe.gillet@schneider-electric.com> wrote:

    Hi,

    I would like to resize up a partition in a special use case.


    I have a 256MB nand chip with 2 yaffs partitions
    /boot of 32MB - nand blocks from 1 to 261
    /usr of 128MB - nand blocks from 262 to 1290
    nand blocks from 1291 to 2047 was never used and are clean
    The resize will be done only once and at boot time. /usr will be increased to 224MB (blocks from 262 to 2047)


    Because of yaffs2 architecture, do you think it is possible to resize up "/usr" partition without any issue on filesytem ?


    Jean-Christophe
    PS: my operating system is vxWorks


    Yes it is very possible to do this, but there are some important issues to doing this properly.

    Let us assume you're doing this while the Yaffs partition in NOT mounted, just to make things simpler...

    1) Make sure the blocks you add are erased (or bad blocks). If you add blocks with data in them, then that will cause confusion.
    2) Make sure the first time you mount after the change that the checkpoint is not used. This can be achieved by one of:
    a) Set flags so that the checkpoint is NOT saved.
    b) Set flags so that the checkpoint is ingroed when booting.

    If your system never writes a checkpoint (eg you always kill power and never do unmounts or other checkpoint writes) then you do not need to worry about (2). If that is the case, and the blocks were never written, then just expand the partition size and your job is done.

    You can even do a resize down of the file system, but that is a little more complicated.

    -- Charles


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________