Re: [PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Nicholas A. Bellinger
On Tue, 2017-07-11 at 09:24 +, Damien Le Moal wrote: > Xiubo, > > Well done ! This fixed my problem. The ZBC test suite now passes all tests on > my target without crashing the kernel. > > Please see some comments/nitpicks below. > > Otherwise, please feel free to add my "tested-by" > Grea

Re: [PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Damien Le Moal
Xiubo, Well done ! This fixed my problem. The ZBC test suite now passes all tests on my target without crashing the kernel. Please see some comments/nitpicks below. Otherwise, please feel free to add my "tested-by" On Tue, 2017-07-11 at 17:06 +0800, Xiubo Li wrote: > On 2017年07月11日 16:05, lixi

Re: [PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread Xiubo Li
To Damien, Please test this, I think this maybe helpful. Thanks, BRs On 2017年07月11日 16:05, lixi...@cmss.chinamobile.com wrote: From: Xiubo Li For all the entries allocated from the ring cmd area, the memory is something like the stack, which will reserve the old data, so the entry->req.i

[PATCH] tcmu: Fix possbile memory leak when recalculating the cmd base size

2017-07-11 Thread lixiubo
From: Xiubo Li For all the entries allocated from the ring cmd area, the memory is something like the stack, which will reserve the old data, so the entry->req.iov_bidi_cnt maybe none zero. To fix this, just memset all the entry memory before using it, and also to be more readable we adjust the