Linux network filesystem support library
 help / color / mirror / Atom feed
* [PATCH] netfs: Fix wrong sort of request put in error handling
@ 2026-04-25  7:32 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2026-04-25  7:32 UTC (permalink / raw)
  To: Christian Brauner
  Cc: dhowells, Paulo Alcantara, netfs, linux-fsdevel, linux-kernel

    
Fix netfs_write_begin() to call netfs_put_request(), not
netfs_put_failed_request(), if it has already tried to dispatch the
request.

Fixes: 453f1cc34a8f ("netfs: Fix leak of request in netfs_write_begin() error handling")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/netfs/buffered_read.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c
index 5c78ec14e46b..7e7dacded8f7 100644
--- a/fs/netfs/buffered_read.c
+++ b/fs/netfs/buffered_read.c
@@ -693,9 +693,9 @@ int netfs_write_begin(struct netfs_inode *ctx,
 
 	netfs_read_to_pagecache(rreq, NULL);
 	ret = netfs_wait_for_read(rreq);
-	if (ret < 0)
-		goto error_put;
 	netfs_put_request(rreq, netfs_rreq_trace_put_return);
+	if (ret < 0)
+		goto error;
 
 have_folio:
 	ret = folio_wait_private_2_killable(folio);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-25  7:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25  7:32 [PATCH] netfs: Fix wrong sort of request put in error handling David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox