diff options
author | Liu Xiaodong <xiaodong.liu@intel.com> | 2023-02-10 15:13:56 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-13 16:36:23 +0100 |
commit | 2f1e07dda1e1310873647abc40bbc49eaf3b10e3 (patch) | |
tree | 5c4e7eb7fc4916c1d26d221367f69adcf8b079c1 /block | |
parent | s390/dasd: Fix potential memleak in dasd_eckd_init() (diff) | |
download | linux-2f1e07dda1e1310873647abc40bbc49eaf3b10e3.tar.xz linux-2f1e07dda1e1310873647abc40bbc49eaf3b10e3.zip |
block: ublk: check IO buffer based on flag need_get_data
Currently, uring_cmd with UBLK_IO_FETCH_REQ or
UBLK_IO_COMMIT_AND_FETCH_REQ is always checked whether
userspace server has provided IO buffer even flag
UBLK_F_NEED_GET_DATA is configured.
This is a excessive check. If UBLK_F_NEED_GET_DATA is
configured, FETCH_RQ doesn't need to provide IO buffer;
COMMIT_AND_FETCH_REQ also doesn't need to do that if
the IO type is not READ.
Check ub_cmd->addr together with ublk_need_get_data()
and IO type in ublk_ch_uring_cmd().
With this fix, userspace server doesn't need to preserve
buffers for every ublk_io when flag UBLK_F_NEED_GET_DATA
is configured, in order to save memory.
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Fixes: c86019ff75c1 ("ublk_drv: add support for UBLK_IO_NEED_GET_DATA")
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230210141356.112321-1-xiaodong.liu@intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions