[stgt] [PATCH] fix leak of shared memory

Doron Shoham dorons at Voltaire.COM
Tue Sep 23 14:43:12 CEST 2008


FUJITA Tomonori wrote:
> On Mon, 15 Sep 2008 17:55:04 +0300
> Doron Shoham <dorons at Voltaire.COM> wrote:
> 
>> fix problem of shared memory (used for logging) not released when tgtd shutdown.
>> this patch fixes the shared memory leak when tgtd is killed.
>> add error messages when log initialization fails.
>>
>> Signed-off-by: Doron Shoham <dorons at voltaire.com>
>> ---
>>  usr/log.c  |  181 ++++++++++++++++++++++++++++++++++++++---------------------
>>  usr/log.h  |    7 +-
>>  usr/tgtd.c |   37 ++++++++++--
>>  3 files changed, 150 insertions(+), 75 deletions(-)
> 
> This patch can't handle the leak due to SIG_KILL?

Normally you should terminate tgtd with SIG_TERM.
Currently tgtd isn't catching this signal.
So, when you use SIG_KILL the shared memory, which was allocated, is not being cleaned up.
In this patch I tried to do the same as in open-iscsi -
clean up all the shared memory when stopping tgtd with SIG_TERM.


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



More information about the stgt mailing list