Re: [PATCH 1/2] zram: free meta out of init_lock

Jerome Marchand
2015-01-23T13:07:58Z

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

On 01/23/2015 06:58 AM, Minchan Kim wrote:
> We don't need to call zram_meta_free, zcomp_destroy and zs_free
> under init_lock. What we need to prevent race with init_lock
> in reset is setting NULL into zram->meta (ie, init_done).
> This patch does it.
>
> Signed-off-by: Minchan Kim <minchan@kernel.org>

Acked-by: Jerome Marchand <jmarchan@redhat.com>

On a side note, when zram->meta replaced init_done, no comment was
added in zram structure to explain that. Things could be made more
explicit.

---
Subject: [PATCH] zram: explicitely state that zram->meta is used to determine
the init state

zram->meta is used to determine the initialization state of a zram structure.
This patch adds a comment to zram structure to make this clear.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
drivers/block/zram/zram_drv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index b05a816..551569a 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -99,7 +99,7 @@ struct zram_meta {
};

struct zram {
- struct zram_meta *meta;
+ struct zram_meta *meta; /* also used to determine the init state */
struct request_queue *queue;
struct gendisk *disk;
struct zcomp *comp;
--
1.9.3

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]