linux/drivers/block
Peter Kalauskas c8bd134a4b drivers/block/zram/zram_drv.c: fix bug storing backing_dev
The call to strlcpy in backing_dev_store is incorrect. It should take
the size of the destination buffer instead of the size of the source
buffer.  Additionally, ignore the newline character (\n) when reading
the new file_name buffer. This makes it possible to set the backing_dev
as follows:

	echo /dev/sdX > /sys/block/zram0/backing_dev

The reason it worked before was the fact that strlcpy() copies 'len - 1'
bytes, which is strlen(buf) - 1 in our case, so it accidentally didn't
copy the trailing new line symbol.  Which also means that "echo -n
/dev/sdX" most likely was broken.

Signed-off-by: Peter Kalauskas <peskal@google.com>
Link: http://lkml.kernel.org/r/20180813061623.GC64836@rodete-desktop-imager.corp.google.com
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: <stable@vger.kernel.org>    [4.14+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-08-22 10:52:45 -07:00
..
aoe drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy 2018-08-08 09:17:20 -06:00
drbd drivers/block/drbd: remove the null check for kmem_cache_destroy 2018-08-08 10:04:42 -06:00
mtip32xx drivers/block/mtip32xx: remove the null check for debugfs_remove_recursive 2018-08-08 09:17:18 -06:00
paride block: paride: pd: mark expected switch fall-throughs 2018-08-09 10:17:38 -06:00
rsxx block: Add and use op_stat_group() for indexing disk_stat fields. 2018-07-18 08:44:20 -06:00
xen-blkback treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
zram drivers/block/zram/zram_drv.c: fix bug storing backing_dev 2018-08-22 10:52:45 -07:00
DAC960.c block/DAC960.c: fix defined but not used build warnings 2018-07-09 09:07:55 -06:00
DAC960.h DAC960: don't use block layer bounce buffers 2018-05-11 15:07:54 -06:00
Kconfig cdrom: Use struct scsi_sense_hdr internally 2018-08-02 15:22:39 -06:00
Makefile block: Rename the null_blk_mod kernel module back into null_blk 2018-07-24 09:54:36 -06:00
amiflop.c
ataflop.c
brd.c block: make bdev_ops->rw_page() take a REQ_OP instead of bool 2018-07-18 08:44:14 -06:00
cryptoloop.c
floppy.c block/floppy: remove redundant variable dflags 2018-07-09 09:07:52 -06:00
loop.c block/loop: mark expected switch fall-through 2018-07-09 09:07:53 -06:00
loop.h loop: remember whether sysfs_create_group() was done 2018-05-07 15:26:36 -06:00
nbd.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-08-02 10:55:32 -07:00
null_blk.h null_blk: add zone support 2018-07-09 09:07:55 -06:00
null_blk_main.c null_blk: add lock drop/acquire annotation 2018-08-09 14:22:41 -06:00
null_blk_zoned.c null_blk: add zone support 2018-07-09 09:07:55 -06:00
pktcdvd.c block: Switch struct packet_command to use struct scsi_sense_hdr 2018-08-02 15:22:13 -06:00
ps3disk.c ps3disk: handle highmem pages 2018-05-11 15:08:03 -06:00
ps3vram.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
rbd.c The main things are support for cephx v2 authentication protocol and 2018-08-20 18:26:55 -07:00
rbd_types.h
skd_main.c block: skd: Use %pad printk format for dma_addr_t values 2018-07-12 15:01:28 -06:00
skd_s1120.h
sunvdc.c
swim.c block/swim: Select appropriate drive on device open 2018-04-16 21:49:35 -06:00
swim3.c block/swim: Rename macros to avoid inconsistent inverted logic 2018-04-16 21:49:35 -06:00
swim_asm.S
sx8.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
umem.c block: Fix a race between the cgroup code and request queue initialization 2018-02-28 12:23:35 -07:00
umem.h
virtio_blk.c block drivers/block: Use octal not symbolic permissions 2018-05-24 13:38:59 -06:00
xen-blkfront.c xen-blkfront: use true and false for boolean values 2018-08-06 08:14:55 -06:00
xsysace.c
z2ram.c treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00