lightnvm: pblk: free padded entries in write buffer
authorJavier González <javier@cnexlabs.com>
Fri, 13 Oct 2017 12:46:03 +0000 (14:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:45:35 +0000 (09:45 +0200)
commit1508043c32a9dfe4af214eb712ab4b5b33158f27
treeef4acf1cae1d704649fef301c7f44ab5be854ed0
parentfd8cb2e71cdd8e814cbdadddd0d0e6e3d49eaa2c
lightnvm: pblk: free padded entries in write buffer

commit cd8ddbf7a5e206fe6995ab0aee245d597dd6a7f2 upstream.

When a REQ_FLUSH reaches pblk, the bio cannot be directly completed.
Instead, data on the write buffer is flushed and the bio is completed on
the completion pah. This might require some sectors to be padded in
order to guarantee a successful write.

This patch fixes a memory leak on the padded pages. A consequence of
this bad free was that internal bios not containing data (only a flush)
were not being completed.

Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/lightnvm/pblk-core.c
drivers/lightnvm/pblk-write.c