Commit e7ccfc4c authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds
Browse files

zram: revalidate disk under init_lock

Commit b4c5c609 ("zram: avoid lockdep splat by revalidate_disk")
moved revalidate_disk call out of init_lock to avoid lockdep
false-positive splat.  However, commit 08eee69f ("zram: remove
init_lock in zram_make_request") removed init_lock in IO path so there
is no worry about lockdep splat.  So, let's restore it.

This patch is needed to set BDI_CAP_STABLE_WRITES atomically in next

Fixes: da9556a2 ("zram: user per-cpu compression streams")

Signed-off-by: default avatarMinchan Kim <>
Reviewed-by: default avatarSergey Senozhatsky <>
Cc: Takashi Iwai <>
Cc: Hyeoncheol Lee <>
Cc: <>
Cc: Sangseok Lee <>
Cc: Hugh Dickins <>
Cc: Darrick J. Wong <>
Cc: <> [4.7+]
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent f0571429
......@@ -1095,14 +1095,8 @@ static ssize_t disksize_store(struct device *dev,
zram->comp = comp;
zram->disksize = disksize;
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
* Revalidate disk out of the init_lock to avoid lockdep splat.
* It's okay because disk's capacity is protected by init_lock
* so that revalidate_disk always sees up-to-date capacity.
return len;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment