netfs: Fix wrong sort of request put in error handling
Subsystems (2)
David Howells
maintainerPATCH 1/1 netfs: Fix wrong sort of request put in error handling
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 <[email protected]>
cc Paulo Alcantara <[email protected]>
--- fs/netfs/buffered_read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/netfs/buffered_read.c +2 -2
@@ -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);