mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 12:34:02 +02:00
netfs: Fix i_size update for partial transfer
Fix netfs_unbuffered_write_done() to pass the amount written to
netfs_update_i_size() in the event of a partial transfer that ends in an
error.
That said, it might be better for the filesystem to mark the inode data as
invalid and recheck it in case something like a network error occurred that
prevented the reply from the server from being received.
Fixes: a0b4c7a491 ("netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence")
Link: https://sashiko.dev/#/patchset/20260824120224.504575-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/20260827134304.2075713-5-dhowells@redhat.com
Acked-by: Paulo Alcantara <pc@manguebit.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
parent
0bfe2571a6
commit
741416a800
|
|
@ -21,7 +21,7 @@ static void netfs_unbuffered_write_done(struct netfs_io_request *wreq)
|
|||
/* Okay, declare that all I/O is complete. */
|
||||
trace_netfs_rreq(wreq, netfs_rreq_trace_write_done);
|
||||
|
||||
if (!wreq->error)
|
||||
if (wreq->transferred)
|
||||
netfs_update_i_size(ictx, &ictx->inode, wreq->start, wreq->transferred);
|
||||
|
||||
if (wreq->origin == NETFS_DIO_WRITE &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user