1
0
Fork 0
alistair23-linux/drivers/block
Minchan Kim b09ab054b6 zram: support BDI_CAP_STABLE_WRITES
zram has used per-cpu stream feature from v4.7.  It aims for increasing
cache hit ratio of scratch buffer for compressing.  Downside of that
approach is that zram should ask memory space for compressed page in
per-cpu context which requires stricted gfp flag which could be failed.
If so, it retries to allocate memory space out of per-cpu context so it
could get memory this time and compress the data again, copies it to the
memory space.

In this scenario, zram assumes the data should never be changed but it is
not true without stable page support.  So, If the data is changed under
us, zram can make buffer overrun so that zsmalloc free object chain is
broken so system goes crash like below

   https://bugzilla.suse.com/show_bug.cgi?id=997574

This patch adds BDI_CAP_STABLE_WRITES to zram for declaring "I am block
device needing *stable write*".

Fixes: da9556a236 ("zram: user per-cpu compression streams")
Link: http://lkml.kernel.org/r/1482366980-3782-4-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>
2017-01-10 18:31:55 -08:00
..
aoe aoe: fix crash in page count manipulation 2016-11-12 08:27:07 -07:00
drbd Merge branch 'for-4.10/block' of git://git.kernel.dk/linux-block 2016-12-13 10:19:16 -08:00
mtip32xx block: mtip32xx: set error code on failure 2016-12-01 08:01:14 -07:00
paride Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
rsxx block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
xen-blkback xen: features and fixes for 4.10 rc0 2016-12-13 16:07:55 -08:00
zram zram: support BDI_CAP_STABLE_WRITES 2017-01-10 18:31:55 -08:00
DAC960.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
DAC960.h
Kconfig pktcdvd: mark as unmaintained and deprecated 2016-11-21 09:33:17 -07:00
Makefile drivers:block: cpqarray clean up 2016-03-15 15:59:47 -07:00
amiflop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ataflop.c Merge branch 'for-3.16/core' of git://git.kernel.dk/linux-block into next 2014-06-02 09:29:34 -07:00
brd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
cciss.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
cciss.h cciss: Adds simple mode functionality 2011-08-08 11:40:15 +02:00
cciss_cmd.h cciss: use new doorbell-bit-5 reset method 2011-05-06 08:23:55 -06:00
cciss_scsi.c scsi: cciss: replace custom function to hexdump 2016-11-08 17:29:57 -05:00
cciss_scsi.h cciss: add cciss_tape_cmds module paramter 2011-05-06 08:23:59 -06:00
cryptoloop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
floppy.c block: floppy: use bio_add_page() 2016-11-22 08:57:55 -07:00
hd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
loop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
loop.h block: loop: support DIO & AIO 2015-09-23 11:01:16 -06:00
mg_disk.c mg_disk: fix error path in mg_probe() 2016-06-28 11:01:27 -06:00
nbd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
null_blk.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
osdblk.c block, drivers: add REQ_OP_FLUSH operation 2016-06-07 13:41:38 -06:00
pktcdvd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ps3disk.c block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
ps3vram.c block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
rbd.c rbd: silence bogus -Wmaybe-uninitialized warning 2016-12-12 23:54:26 +01:00
rbd_types.h rbd: support for exclusive-lock feature 2016-08-24 23:49:16 +02:00
skd_main.c skd_main: drop duplicate header scatterlist.h 2016-11-18 07:44:21 -07:00
skd_s1120.h skd: fix formatting in skd_s1120.h 2013-11-08 09:10:30 -07:00
smart1,2.h fix typos 'comamnd' -> 'command' in comments 2011-02-02 11:31:21 +01:00
sunvdc.c block: convert to device_add_disk() 2016-06-27 12:26:08 -07:00
swim.c block: drop owner assignment from platform_drivers 2014-10-20 16:20:18 +02:00
swim3.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
swim_asm.S
sx8.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
umem.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
umem.h
virtio_blk.c virtio_blk: Delete an unnecessary initialisation in init_vq() 2016-10-31 00:21:47 +02:00
xen-blkfront.c xen: features and fixes for 4.10 rc0 2016-12-13 16:07:55 -08:00
xsysace.c block: systemace: Remove .owner field for driver 2014-08-21 20:37:54 -05:00
z2ram.c block: remove struct request buffer member 2014-04-15 14:03:02 -06:00