[PATCH] nvmet: free the bvec on file namespace range errors

Keith Busch kbusch at kernel.org
Tue Oct 13 08:40:32 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.

Thanks, applied to nvme-7.4.



More information about the Linux-nvme mailing list