[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <170144199127.633830.5706636957999053594.b4-ty@mit.edu>
Date: Fri, 1 Dec 2023 09:46:54 -0500
From: "Theodore Ts'o" <tytso@....edu>
To: Jan Kara <jack@...e.cz>
Cc: "Theodore Ts'o" <tytso@....edu>, linux-ext4@...r.kernel.org,
Ritesh Harjani <ritesh.list@...il.com>,
syzbot+47479b71cdfc78f56d30@...kaller.appspotmail.com
Subject: Re: [PATCH v2] ext4: Fix warning in ext4_dio_write_end_io()
On Thu, 30 Nov 2023 10:56:53 +0100, Jan Kara wrote:
> The syzbot has reported that it can hit the warning in
> ext4_dio_write_end_io() because i_size < i_disksize. Indeed the
> reproducer creates a race between DIO IO completion and truncate
> expanding the file and thus ext4_dio_write_end_io() sees an inconsistent
> inode state where i_disksize is already updated but i_size is not
> updated yet. Since we are careful when setting up DIO write and consider
> it extending (and thus performing the IO synchronously with i_rwsem held
> exclusively) whenever it goes past either of i_size or i_disksize, we
> can use the same test during IO completion without risking entering
> ext4_handle_inode_extension() without i_rwsem held. This way we make it
> obvious both i_size and i_disksize are large enough when we report DIO
> completion without relying on unreliable WARN_ON.
>
> [...]
Applied, thanks!
[1/1] ext4: Fix warning in ext4_dio_write_end_io()
commit: 619f75dae2cf117b1d07f27b046b9ffb071c4685
Best regards,
--
Theodore Ts'o <tytso@....edu>
Powered by blists - more mailing lists