Re: [Yaffs] data loss under heavy pressure on Yaffs2 GC --> …

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: lkml@looxix.net
Date:  
To: Luc Van Oostenryck
CC: Luc Van Oostenryck, Charles Manning, yaffs
New-Topics: [Yaffs] [PATCH RFC YAFFS] fix writepage when extending a file
Subject: Re: [Yaffs] data loss under heavy pressure on Yaffs2 GC --> fix
> Luc Van Oostenryck wrote:

<snip>

> Yes, there seems to be something missing.
>
> The others fs use something like a mix of calling vmtruncate() and/or
> something like the code below,
> either in setattr() or XXX_truncate() (to add in inode_operations and
> called by vmtruncate if present)
>
>     page = grab_cache_page(inode->i_mapping, inode->i_size >>
> PAGE_CACHE_SHIFT) // or attrs->ia_size  >> PAGE_CACHE_SHIFT
>     // if needed, fill with zeroes the partial page
>     // there is already a/some function to do this
>     flush_dcache_page(page);
>     unlock_page(page);
>     page_cache_release(page);

>


Forget about this for the moment.
vmtruncate() is called via inode_settattr() which is done at the and of
yaffs_setattr()
And vmtruncate()can call a method "truncate" if implemented
This method doesn't seems to be needed for the way we actually do the
truncation/resizing.

>
> I will need to investigate much further.
>


I hadn't enough time yesterday, but there is something that I don't
understand: in yaffs_setattr() -> yaffs_SetAttributes() ->
yaffs_ResizeFile(), how the object filesize is changed if newSize >
oldFileSize ?
>From what I understand, it this never changed.


Apart this, I think that in the case of a resizing down, the object header
can be updated several times: once in yaffs_ResizeFile and once in
yaffs_SetAttributes.


Luc