[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dd1b01babe2b5023e9e26c56a2f2b458@manguebit.org>
Date: Thu, 26 Jun 2025 10:37:08 -0300
From: Paulo Alcantara <pc@...guebit.org>
To: David Howells <dhowells@...hat.com>, Christian Brauner
<brauner@...nel.org>, Steve French <sfrench@...ba.org>
Cc: dhowells@...hat.com, linux-cifs@...r.kernel.org, netfs@...ts.linux.dev,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] netfs: Fix i_size updating
David Howells <dhowells@...hat.com> writes:
> Fix the updating of i_size, particularly in regard to the completion of DIO
> writes and especially async DIO writes by using a lock.
>
> The bug is triggered occasionally by the generic/207 xfstest as it chucks a
> bunch of AIO DIO writes at the filesystem and then checks that fstat()
> returns a reasonable st_size as each completes.
>
> The problem is that netfs is trying to do "if new_size > inode->i_size,
> update inode->i_size" sort of thing but without a lock around it.
>
> This can be seen with cifs, but shouldn't be seen with kafs because kafs
> serialises modification ops on the client whereas cifs sends the requests
> to the server as they're generated and lets the server order them.
>
> Fixes: 153a9961b551 ("netfs: Implement unbuffered/DIO write support")
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Steve French <sfrench@...ba.org>
> cc: Paulo Alcantara <pc@...guebit.org>
> cc: linux-cifs@...r.kernel.org
> cc: netfs@...ts.linux.dev
> cc: linux-fsdevel@...r.kernel.org
> ---
> fs/netfs/buffered_write.c | 2 ++
> fs/netfs/direct_write.c | 8 ++++++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
Reviewed-by: Paulo Alcantara (Red Hat) <pc@...guebit.org>
Powered by blists - more mailing lists