[Devel] [PATCH RHEL9 COMMIT] dm-ploop: use helper to initialize kiocb

Konstantin Khorenko khorenko at virtuozzo.com
Mon Oct 17 16:30:16 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-70.22.1.vz9.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-70.22.1.vz9.17.8
------>
commit e8f099603ae15dca33a53438856056bd339711f8
Author: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
Date:   Tue Sep 20 11:26:33 2022 +0300

    dm-ploop: use helper to initialize kiocb
    
    Initialize kiocb with init_sync_kiocb(...)
    which handles file flags, write hints and ioprio.
    
    Bios can get merged wrong if ioprio is not set early -
    20578bdfd041 ("block: Initialize BIO I/O priority early") for details.
    
    https://jira.sw.ru/browse/PSBM-142045
    Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
---
 drivers/md/dm-ploop-target.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-ploop-target.c b/drivers/md/dm-ploop-target.c
index 1db5055c2e39..4f7dc36eee0c 100644
--- a/drivers/md/dm-ploop-target.c
+++ b/drivers/md/dm-ploop-target.c
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/file.h>
+#include <linux/fs.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/uio.h>
@@ -56,11 +57,9 @@ void ploop_call_rw_iter(struct file *file, loff_t pos, unsigned rw,
 	struct kiocb *iocb = &pio->iocb;
 	int ret;
 
+	init_sync_kiocb(iocb, file);
 	iocb->ki_pos = pos;
-	iocb->ki_filp = file;
 	iocb->ki_complete = ploop_aio_complete;
-	iocb->ki_flags = IOCB_DIRECT;
-	iocb->ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0);
 
 	atomic_set(&pio->aio_ref, 2);
 


More information about the Devel mailing list