[PATCH] nvmet: free the bvec on file namespace range errors
Christoph Hellwig
hch at lst.de
Tue Oct 13 07:30:48 PDT 2026
On Wed, Oct 07, 2026 at 07:27:46PM +0000, Jérémy Jean wrote:
> nvmet_file_execute_rw() allocates the bvec before
> nvmet_file_execute_io() checks whether the request fits in the backing
> file. If the request extends beyond the file, nvmet_file_execute_io()
> calls nvmet_req_complete() to return an error. This skips
> nvmet_file_io_done(), so the allocated memory is never freed. Repeated
> requests can exhaust memory.
>
> Use nvmet_file_io_done() to free the bvec before returning the range
> error to the client.
Looks good:
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the Linux-nvme
mailing list