nvmet-tcp: fix a memory leak when releasing a queue
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 15 Oct 2021 08:26:34 +0000 (10:26 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 26 Oct 2021 08:41:29 +0000 (10:41 +0200)
commit926245c7d22271307606c88b1fbb2539a8550e94
tree5381a629670908a2e13461f6160d67563260518c
parent9fbfabfda25d8774c5a08634fdd2da000a924890
nvmet-tcp: fix a memory leak when releasing a queue

page_frag_free() won't completely release the memory
allocated for the commands, the cache page must be explicitly
freed by calling __page_frag_cache_drain().

This bug can be easily reproduced by repeatedly
executing the following command on the initiator:

$echo 1 > /sys/devices/virtual/nvme-fabrics/ctl/nvme0/reset_controller

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/tcp.c