>-----Original Message-----
>From: Jaegeuk Kim [mailto:[email protected]]
>Sent: Thursday, January 04, 2018 5:44 AM
>To: heyunlei
>Cc: Yuchao (T); [email protected]; Wangbintian; Jianing 
>(Euler)
>Subject: Re: [f2fs-dev][PATCH] f2fs: update inode info to inode page for new 
>file
>
>On 01/03, Yunlei He wrote:
>>                      |
>>                      | 1. creat a new file A ,(with dirty inode
>>                      |    && dirty inode page && xattr info)
>>                      | 2. backgroud wb write back file A inode
>>      last checkpoint |    page (without update from inode cache)
>
>f2fs_sync_inode_meta() would flush dirty inode cache, no?

f2fs_sync_inode_meta() would flush dirty inode cache in write new checkpoint.
But here bdi flusher would write back zero inode page without update from inode 
cache.

Thanks.

>
>
>>                      | 3. fsync file A, write back inode page of
>>                      |    file A with inode cache info
>>                      | 4. sudden power off before new checkpoint
>>
>> In this case, recovery process will try to recover a zero inode
>> page. Inline xattr flag of file A will be miss and xattr info
>> will be taken as blkaddr index.
>>
>> Signed-off-by: Yunlei He <[email protected]>
>> ---
>>  fs/f2fs/dir.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
>> index 724304d..d04dcac 100644
>> --- a/fs/f2fs/dir.c
>> +++ b/fs/f2fs/dir.c
>> @@ -427,6 +427,8 @@ struct page *init_inode_metadata(struct inode *inode, 
>> struct inode *dir,
>>                      remove_orphan_inode(F2FS_I_SB(dir), inode->i_ino);
>>              f2fs_i_links_write(inode, true);
>>      }
>> +
>> +    update_inode(inode, page);
>>      return page;
>>
>>  put_error:
>> --
>> 1.9.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to