summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2017-01-10 16:58:18 -0800
committerAmit Pundir <amit.pundir@linaro.org>2018-10-04 14:16:10 +0530
commitba6cca5f80fb306055ab79d094c146a7a6dfc316 (patch)
tree1a17b51b148dc279b017b09da13740a61d09ac35 /drivers/block
parent199c3c6ef2e193e8c40c1a7323995a74630c4edf (diff)
UPSTREAM: zram: revalidate disk under init_lock
Commit b4c5c60920e3 ("zram: avoid lockdep splat by revalidate_disk") moved revalidate_disk call out of init_lock to avoid lockdep false-positive splat. However, commit 08eee69fcf6b ("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 patch. Fixes: da9556a2367c ("zram: user per-cpu compression streams") Link: http://lkml.kernel.org/r/1482366980-3782-3-git-send-email-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Takashi Iwai <tiwai@suse.de> Cc: Hyeoncheol Lee <cheol.lee@lge.com> Cc: <yjay.kim@lge.com> Cc: Sangseok Lee <sangseok.lee@lge.com> Cc: Hugh Dickins <hughd@google.com> Cc: Darrick J. Wong <darrick.wong@oracle.com> Cc: <stable@vger.kernel.org> [4.7+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit e7ccfc4ccb703e0f033bd4617580039898e912dd) Signed-off-by: Peter Kalauskas <peskal@google.com> Bug: 112488418 Change-Id: Iebb6f694e46a797f8ce34029857c01c0c71086c7 Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/zram/zram_drv.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 38a6181be4b4..ce56b48cb09d 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1091,14 +1091,8 @@ static ssize_t disksize_store(struct device *dev,
zram->comp = comp;
zram->disksize = disksize;
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
- up_write(&zram->init_lock);
-
- /*
- * 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.
- */
revalidate_disk(zram->disk);
+ up_write(&zram->init_lock);
return len;