Re: kmem_cache_destroy tcm_loop_cmd_cache: Slab cache still has objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sebastian,

On Tue, 2014-06-17 at 22:59 +0200, Sebastian Herbszt wrote:
> Hello,
> 
> I got the following output with
> 
> # modprobe target_core_mod 
> # modprobe target_core_file
> # modprobe tcm_loop
> 
> # mkdir -p /sys/kernel/config/target/core/fileio_0/file0
> # echo 'fd_dev_name=/disk1,fd_dev_size=10485760' > /sys/kernel/config/target/core/fileio_0/file0/control
> # echo 1 > /sys/kernel/config/target/core/fileio_0/file0/enable
> 
> # mkdir -p /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0
> # ln -s /sys/kernel/config/target/core/fileio_0/file0 /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/file0
> 
> # rm /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/file0
> # rmdir /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0
> # rmdir /sys/kernel/config/target/loopback/fc.1/tpgt_0
> # rmdir /sys/kernel/config/target/loopback/fc.1
> # rmdir /sys/kernel/config/target/loopback
> # rmmod tcm_loop
> # dmesg
> 
> Sebastian
> 
> [22190.572259] scsi4 : TCM_Loopback
> [22196.959666] scsi 4:0:0:0: TCM_Loop I_T Nexus does not exist
> [22196.966793] scsi 4:0:0:0: TCM_Loop I_T Nexus does not exist
> [22196.974736] scsi 4:0:0:0: TCM_Loop I_T Nexus does not exist
> [22196.982696] scsi 4:0:0:0: TCM_Loop I_T Nexus does not exist
> [22205.880851] Unable to locate struct scsi_device for 0:0:0
> [22242.980589] kmem_cache_destroy tcm_loop_cmd_cache: Slab cache still has objects
> [22242.980704] CPU: 0 PID: 3184 Comm: rmmod Not tainted 3.15.0-2.gc9b3c8c-default #1
> [22242.980711] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2012
> [22242.980722]  ffffffffa03c2620 ffffffff815b2ea2 ffff880034b8c140 ffffffff81159579
> [22242.980730]  0000000000000000 ffffffffa03bfa8a ffffffff810cc344 00000000301d1478
> [22242.980735]  ffffffffa03c2620 ffff880000000880 ffff8800001abf0c 706f6f6c5f6d6374
> [22242.980741] Call Trace:
> [22242.981060]  [<ffffffff81004aa6>] dump_trace+0x86/0x330
> [22242.981078]  [<ffffffff81004de4>] show_stack_log_lvl+0x94/0x170
> [22242.981088]  [<ffffffff810061e1>] show_stack+0x21/0x50
> [22242.981201]  [<ffffffff815b2ea2>] dump_stack+0x41/0x51
> [22242.998642]  [<ffffffff81159579>] kmem_cache_destroy+0xb9/0xe0
> [22242.998688]  [<ffffffffa03bfa8a>] tcm_loop_fabric_exit+0x4b/0x5c1 [tcm_loop]
> [22242.998734]  [<ffffffff810cc344>] SyS_delete_module+0x154/0x1f0
> [22242.998745]  [<ffffffff815c17ed>] system_call_fastpath+0x1a/0x1f
> [22242.998759]  [<00007f2078e98047>] 0x7f2078e98046
> --

Looks like a tcm_loop_cmd memory leak on error when no loopback I_T
nexus has been configured.

Here is the bugfix that I'll be including in the next v3.16-rc PULL
request.  Please confirm on your end.

Thanks for reporting!

--nab

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 1f4c015..daa538d 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -239,6 +239,7 @@ static void tcm_loop_submission_work(struct work_struct *work)
 	return;
 
 out_done:
+	kmem_cache_free(tcm_loop_cmd_cache, tl_cmd);
 	sc->scsi_done(sc);
 	return;
 }

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux