[Yaffs] Re: yaffs robustness against power failures

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Vitaly Wool
Date:  
To: Charles Manning
CC: wookey, yaffs
New-Topics: Re: [Yaffs] Re: yaffs robustness against power failures -->transactioned writes
Subject: [Yaffs] Re: yaffs robustness against power failures
Hi Charles,

Charles Manning wrote:

>You will end up with a partial write. eg. If you have 500k free and you
>attempt to write 1MB then 500k will be written and the write call will return
>500k.
>
>YAFFS keeps enough space in reserve to flush any in-flight internal cache and
>flush file handles etc.
>
>What definitely will not happen is file structure getting corrupted.
>
>

thanks! However I meant the following situation: suppose we've got 500k
free, and we're trying to write a new version of 1M file (i. e. rewrite
the old one). How will the filesystem handle this? I. e. will it refuse
the write operation or grant it? If latter, what will happen if a power
failure happens in the midst of the write (for instance, when 600k is
written already -- there's not enough space to hold both the old and the
new versions so how will the incomplete write be reverted?)
OTOH, if there's enough space to hold both the old and the new versions,
will the power pailure always be handled by the filesystem in such a way
that retains the integrity of the file being written (i. e. either the
old or the new version). I hope it will, but still being sure is better
than thinking 'probably it will' :)

Thanks,
Vitaly