Re: [RFC PATCH 17/17] netfs: Combine prepare and issue ops and grab the buffers on request

ChenXiaoSong
2026-03-24T01:04:23Z

In netfs_writeback_single(), on the failure path, should we call
netfs_put_failed_request() instead of netfs_put_request()?

```
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -1041,7 +1041,7 @@ int netfs_writeback_single(struct address_space
*mapping,
return ret;

cleanup_free:
- netfs_put_request(wreq, netfs_rreq_trace_put_return);
+ netfs_put_failed_request(wreq, netfs_rreq_trace_put_return);
couldnt_start:
mutex_unlock(&ictx->wb_lock);
_leave(" = %d", ret);
```

Thanks,
ChenXiaoSong <chenxiaosong@kylinos.cn>

On 3/24/26 06:44, Paulo Alcantara wrote:
> Thanks for the review. The above is still broken as it wolud cause an
> UAF on @subreq as we're putting it with netfs_put_subrequest() and then
> dereferencing it afterwards.
>
> Besides, we could also get rid of 'subreq = NULL' as it is currently a
> no-op -- including in other places.
>
> Let's wait for next patchset from Dave, though.