Re: [PATCH] nvmet: free the bvec on file namespace range errors
From: Christoph Hellwig
Date: Tue Oct 13 2026 - 11:25:20 EST
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@xxxxxx>