lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 18 Oct 2023 14:45:49 +0800
From:   Joseph Qi <>
To:     Jan Kara <>, Ted Tso <>
        "Ritesh Harjani (IBM)" <>,
        Gao Xiang <>,
        Dave Chinner <>,
        Joseph Qi <>
Subject: Re: [PATCH v3] ext4: Properly sync file size update after O_SYNC
 direct IO

On 10/13/23 8:13 PM, Jan Kara wrote:
> Gao Xiang has reported that on ext4 O_SYNC direct IO does not properly
> sync file size update and thus if we crash at unfortunate moment, the
> file can have smaller size although O_SYNC IO has reported successful
> completion. The problem happens because update of on-disk inode size is
> handled in ext4_dio_write_iter() *after* iomap_dio_rw() (and thus
> dio_complete() in particular) has returned and generic_file_sync() gets
> called by dio_complete(). Fix the problem by handling on-disk inode size
> update directly in our ->end_io completion handler.
> References:
> Reported-by: Gao Xiang <>
> CC:
> Fixes: 378f32bab371 ("ext4: introduce direct I/O write using iomap infrastructure")
> Signed-off-by: Jan Kara <>

Tested with the reproducer after applying to 6.6-rc5,
Tested-by: Joseph Qi <>

BTW, once backported to older kernel like 5.10, it seems that it depends
on the following commit:
936e114a245b iomap: update ki_pos a little later in iomap_dio_complete

Otherwise, it will fail the following xfstests cases:
generic/091 generic/094 generic/225 generic/263 generic/311 generic/617


Powered by blists - more mailing lists