[Devel] [PATCH RH7] ploop: Inherit stacking limits for ext4 over io_kaio

Kirill Tkhai ktkhai at virtuozzo.com
Mon Jun 22 16:54:14 MSK 2020


Otherwise, a bio that bigger then the underlining blockdev,
may be submitted:

    bio too big device dm-0 (2048 > 512)
    EXT4-fs warning (device ploop26646p1): ext4_end_bio:302: I/O error -5
    writing to inode 137338 (offset 0 size 0 starting block 233984)
    Buffer I/O error on device ploop26646p1, logical block 233728

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/io_kaio.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/block/ploop/io_kaio.c b/drivers/block/ploop/io_kaio.c
index 38b807b9253a..6d6517dcf2e5 100644
--- a/drivers/block/ploop/io_kaio.c
+++ b/drivers/block/ploop/io_kaio.c
@@ -1122,6 +1122,16 @@ static void kaio_unplug(struct ploop_io * io)
 
 static void kaio_queue_settings(struct ploop_io * io, struct request_queue * q)
 {
+	struct file  *file  = io->files.file;
+	struct inode *inode = file->f_mapping->host;
+
+	if (inode->i_sb->s_magic == EXT4_SUPER_MAGIC) {
+		WARN_ON(!kaio_backed_ext4);
+		blk_queue_stack_limits(q, bdev_get_queue(io->files.bdev));
+		ploop_set_discard_limits(io->plo);
+		return;
+	}
+
 	blk_set_stacking_limits(&q->limits);
 	/*
 	 * Maintaince mode based discard splits a big bio itself,




More information about the Devel mailing list