nullb: free zones when device is power-off - #1137
Conversation
|
Upstream branch: 3aa1dca |
d89ab11 to
fdba928
Compare
|
Upstream branch: fd923b3 |
052a8e4 to
eee90c8
Compare
fdba928 to
60442a3
Compare
|
Upstream branch: 8d3ae59 |
eee90c8 to
f651ef8
Compare
60442a3 to
3df366e
Compare
|
Upstream branch: bd5f485 |
f651ef8 to
dadbef1
Compare
3df366e to
5dd70cb
Compare
|
Upstream branch: 66498c7 |
dadbef1 to
81e0aba
Compare
5dd70cb to
055a766
Compare
|
Upstream branch: 502d457 |
81e0aba to
65be70b
Compare
055a766 to
341ae8c
Compare
|
Upstream branch: cf72cbb |
65be70b to
6e0c099
Compare
341ae8c to
940e422
Compare
|
Upstream branch: cee9395 |
6e0c099 to
00fe3ab
Compare
940e422 to
3cab524
Compare
|
Upstream branch: 89a3129 |
00fe3ab to
c405553
Compare
3cab524 to
8242bf1
Compare
|
Upstream branch: bc35965 |
c405553 to
16422c3
Compare
8242bf1 to
5b28f57
Compare
|
Upstream branch: df29080 Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/series/1145940/ conflict: |
5b28f57 to
4ddd216
Compare
|
Upstream branch: 28924df |
16422c3 to
66d63fa
Compare
4ddd216 to
00cc4ca
Compare
|
Upstream branch: 893e117 |
66d63fa to
19510b0
Compare
00cc4ca to
7efd8cd
Compare
|
Upstream branch: 50d05c7 |
A user powers off the device by writing 0 to `./config/nullb/nullb1/power`
via the nullb configfs interface, and later powers it on by writing 1
to the same file.
When the power-off command is executed, the zones created by the previous
task are not freed before new zones are created upon powering on again;
this results in the memory leak described in [1].
Add an operation to free zones within nullb_device_power_store().
[1]
BUG: memory leak
unreferenced object 0xffff888126990000 (size 56000):
backtrace (crc 5c9573f8):
null_init_zoned_dev+0x108/0x520 drivers/block/null_blk/zoned.c:94
null_add_dev+0x8a6/0xae0 drivers/block/null_blk/main.c:1993
nullb_device_power_store+0xf9/0x1f0 drivers/block/null_blk/main.c:501
flush_write_buffer fs/configfs/file.c:207 [inline]
configfs_write_iter+0x10d/0x1a0 fs/configfs/file.c:229
new_sync_write fs/read_write.c:595 [inline]
vfs_write+0x3ac/0x720 fs/read_write.c:687
Fixes: cedcafa ("nullb: add interface to power on disk")
Reported-by: syzbot+f57d67a92532a98a562d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f57d67a92532a98a562d
Tested-by: syzbot+f57d67a92532a98a562d@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
19510b0 to
4f33cb2
Compare
Pull request for series with
subject: nullb: free zones when device is power-off
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1145940