zram: avoid lockdep splat by revalidate_disk
authorMinchan Kim <minchan@kernel.org>
Wed, 23 Jul 2014 21:00:04 +0000 (14:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Jul 2014 22:10:54 +0000 (15:10 -0700)
commitb4c5c60920e3b0c4598f43e7317559f6aec51531
tree558613a15eb002c5a0aef4f77c99efc741cd5b4f
parenta0f7a756c2f7543585657cdeeefdfcc11b567293
zram: avoid lockdep splat by revalidate_disk

Sasha reported lockdep warning [1] introduced by [2].

It could be fixed by doing disk revalidation out of the init_lock.  It's
okay because disk capacity change is protected by init_lock so that
revalidate_disk always sees up-to-date value so there is no race.

[1] https://lkml.org/lkml/2014/7/3/735
[2] zram: revalidate disk after capacity change

Fixes 2e32baea46ce ("zram: revalidate disk after capacity change").

Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: "Alexander E. Patrakov" <patrakov@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/zram/zram_drv.c