Re: [RFC PATCH 17/17] netfs: Combine prepare and issue ops and grab the buffers on request
ChenXiaoSong <[email protected]>
| Newsgroups | dev.linux.lists.v9fs,dev.linux.lists.netfs,org.kernel.vger.ceph-devel,org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
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.