Re: [PATCH] ext4: defer updating i_disksize until endio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 27, 2023 at 5:29 PM Jan Kara <jack@xxxxxxx> wrote:
>
> As Zhang Yi already noted in his review, this is expected at least with
> data=writeback mount option. With data=ordered this should not happen
> though as the commit of the transaction with i_disksize update will wait
> for page writeback to complete (this is exactly the reason why data=ordered
> exists after all). Are you able to observe this problem with data=ordered
> mount option?
>
>                                                                 Honza

It's a pity that this issue also occurs with data=ordered due to delayed
allocation being enabled by default. If delayed allocation were disabled,
it would not be as easy to reproduce.

This is because if data is written to the end of a file and the block is
allocated, the new i_disksize will be immediately committed to the journal
at ext4_da_write_end(), but the writeback procedure is not yet triggered.
By default, ext4 commits the journal every 5 seconds, but a dirty page may
not be written back until 30 seconds later. This is not a short time window,
and any improper shutdown during this time may lead to the issue :(

Thanks.
C.C.Cheng




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux