Subsystems (2)
Bcc:
Subject: Re: [PATCH] zram: don't free statically defined names Reply-To:
In-Reply-To: <[email protected]>
Cc-ing Venkat Rao Bagalkote
Quoted 14 lines · Sergey Senozhatsky
Review
Quoted 3 lines
(quoted diff) +1
-1for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) { - kfree(zram->comp_algs[prio]); + /* Do not free statically defined compression algorithms */We probably don't really need this comment.
Review
Quoted 4 lines
(quoted diff) +2
-0+ if (zram->comp_algs[prio] != default_compressor) + kfree(zram->comp_algs[prio]); zram->comp_algs[prio] = NULL; }OK, so... I wonder how do you get a
default_compressoron a non-ZRAM_PRIMARY_COMP prio. May I ask what's your reproducer?
Quoted 7 lines
I didn't expect
default_compressoronZRAM_SECONDARY_COMPand below. As far as I can tell, we only do this:comp_algorithm_set(zram, ZRAM_PRIMARY_COMP, default_compressor);in
zram_reset_device()andzram_add(). So, how does it end up inZRAM_SECONDARY_COMP...
Ugh, I know what's happening. You don't have CONFIG_ZRAM_MULTI_COMP so that ZRAM_PRIMARY_COMP and ZRAM_SECONDARY_COMP are the same thing. Yeah, that all makes sense now, I haven't thought about it.
Can you please send v2 (with the feedback resolved).