linux-stable/drivers/block
Nitesh Shetty 711f727f7b null_blk: Fix: memory release when memory_backed=1
[ Upstream commit 8cfb98196c ]

Memory/pages are not freed, when unloading nullblk driver.

Steps to reproduce issue
  1.free -h
        total        used        free      shared  buff/cache   available
Mem:    7.8Gi       260Mi       7.1Gi       3.0Mi       395Mi       7.3Gi
Swap:      0B          0B          0B
  2.modprobe null_blk memory_backed=1
  3.dd if=/dev/urandom of=/dev/nullb0 oflag=direct bs=1M count=1000
  4.modprobe -r null_blk
  5.free -h
        total        used        free      shared  buff/cache   available
Mem:    7.8Gi       1.2Gi       6.1Gi       3.0Mi       398Mi       6.3Gi
Swap:      0B          0B          0B

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
Link: https://lore.kernel.org/r/20230605062354.24785-1-nj.shetty@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 11:12:39 +02:00
..
aoe block: aoe: use DEFINE_SHOW_ATTRIBUTE to simplify aoe_debugfs 2022-09-21 19:49:24 -06:00
drbd drbd: correctly submit flush bio on barrier 2023-05-11 23:03:39 +09:00
mtip32xx block: move from strlcpy with unused retval to strscpy 2022-09-21 19:45:04 -06:00
null_blk null_blk: Fix: memory release when memory_backed=1 2023-06-28 11:12:39 +02:00
paride block: Change the type of req_op() and bio_op() into enum req_op 2022-07-14 12:14:30 -06:00
rnbd block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE 2023-06-09 10:34:09 +02:00
xen-blkback xen: branch for v6.0-rc4 2022-09-03 13:23:11 -07:00
zram - Alistair Popple has a series which addresses a race which causes page 2022-10-14 12:28:43 -07:00
amiflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ataflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
brd.c brd: use radix_tree_maybe_preload instead of radix_tree_preload 2023-03-10 09:34:34 +01:00
floppy.c floppy: Fix memory leak in do_floppy_init() 2022-12-31 13:33:11 +01:00
Kconfig ublk_drv: comment on ublk_driver entry of Kconfig 2022-10-31 07:23:24 -06:00
loop.c loop: LOOP_CONFIGURE: send uevents for partitions 2023-04-06 12:10:47 +02:00
Makefile remove the sx8 block driver 2022-08-02 17:22:46 -06:00
n64cart.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
nbd.c nbd: Fix debugfs_create_dir error checking 2023-06-09 10:34:09 +02:00
pktcdvd.c pktcdvd: check for NULL returna fter calling bio_split_to_limits() 2023-01-24 07:24:37 +01:00
ps3disk.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ps3vram.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:58:33 +01:00
rbd.c rbd: get snapshot context after exclusive lock is ensured to be held 2023-06-14 11:15:28 +02:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:33:47 +01:00
swim.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim3.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim_asm.S
ublk_drv.c ublk: fix AB-BA lockdep warning 2023-06-09 10:34:16 +02:00
virtio_blk.c virtio_blk: Fix signedness bug in virtblk_prep_rq() 2023-01-12 12:02:54 +01:00
xen-blkfront.c xen/blkfront: Only check REQ_FUA for writes 2023-06-21 16:00:53 +02:00
z2ram.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00