lkml.org 
[lkml]   [2014]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 2/6] fat: add fat_fallocate operation
From
>> [...]
>>
>>> + /* Release unwritten fallocated blocks on inode eviction. */
>>> + if (MSDOS_I(inode)->mmu_private < MSDOS_I(inode)->i_disksize) {
>>> + int err;
>>> + fat_truncate_blocks(inode, MSDOS_I(inode)->mmu_private);
>>> + /* Fallocate results in updating the i_start/iogstart
>>> + * for the zero byte file. So, make it return to
>>> + * original state during evict and commit it
>>> + * synchrnously to avoid any corruption on the next
>>> + * access to the cluster chain for the file.
>>> + */
>>> + err = fat_sync_inode(inode);
>>
>> Ah, good catch. We have to update i_size. I was forgetting about this.
>> Well, sync inode unconditionally would not be good. Maybe, we better to
>> use __fat_write_inode() with inode_needs_sync() or such.
> Okay, I will change it.
Hi OGAWA

When I checked more, we should wait till inode is sync. Because in the
eviction it will leave the inode/buffers being marked dirty.
Not waiting for it get sync over here. It will leave cluster chain
corrupted when remounting.
It mean we cannot use __fat_write_inode with inode_needs_sync() conditionally.

Thanks.
>
> Thanks.
>> --
>> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
>>
>


\
 
 \ /
  Last update: 2014-02-14 06:22    [W:0.091 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site