Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.org>
To: David Howells <dhowells@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	Steve French <sfrench@samba.org>
Cc: dhowells@redhat.com, linux-cifs@vger.kernel.org,
	netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfs: Fix i_size updating
Date: Thu, 26 Jun 2025 10:37:08 -0300	[thread overview]
Message-ID: <dd1b01babe2b5023e9e26c56a2f2b458@manguebit.org> (raw)
In-Reply-To: <1576470.1750941177@warthog.procyon.org.uk>

David Howells <dhowells@redhat.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@redhat.com>
> cc: Steve French <sfrench@samba.org>
> cc: Paulo Alcantara <pc@manguebit.org>
> cc: linux-cifs@vger.kernel.org
> cc: netfs@lists.linux.dev
> cc: linux-fsdevel@vger.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@manguebit.org>

  parent reply	other threads:[~2025-06-26 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 12:32 [PATCH] netfs: Fix i_size updating David Howells
2025-06-26 12:44 ` [PATCH] netfs: Merge i_size update functions David Howells
2025-07-01 11:41   ` Christian Brauner
2025-06-26 13:37 ` Paulo Alcantara [this message]
2025-06-26 14:07   ` [PATCH] netfs: Fix i_size updating Steve French
2025-07-01 11:42 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd1b01babe2b5023e9e26c56a2f2b458@manguebit.org \
    --to=pc@manguebit.org \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfs@lists.linux.dev \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox