From: Greg Kroah-Hartman Date: Tue, 5 Dec 2023 17:59:05 +0000 (+0900) Subject: 6.1-stable patches X-Git-Tag: v4.14.332~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efd2b8ab1b41c000b0acddf25e061120a14ffa0d;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch --- diff --git a/queue-6.1/iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch b/queue-6.1/iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch new file mode 100644 index 00000000000..f1cb35e81de --- /dev/null +++ b/queue-6.1/iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch @@ -0,0 +1,80 @@ +From 936e114a245b6e38e0dbf706a67e7611fc993da1 Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Thu, 1 Jun 2023 16:58:54 +0200 +Subject: iomap: update ki_pos a little later in iomap_dio_complete + +From: Christoph Hellwig + +commit 936e114a245b6e38e0dbf706a67e7611fc993da1 upstream. + +Move the ki_pos update down a bit to prepare for a better common helper +that invalidates pages based of an iocb. + +Link: https://lkml.kernel.org/r/20230601145904.1385409-3-hch@lst.de +Signed-off-by: Christoph Hellwig +Reviewed-by: Damien Le Moal +Reviewed-by: Hannes Reinecke +Reviewed-by: Darrick J. Wong +Cc: Al Viro +Cc: Andreas Gruenbacher +Cc: Anna Schumaker +Cc: Chao Yu +Cc: Christian Brauner +Cc: Ilya Dryomov +Cc: Jaegeuk Kim +Cc: Jens Axboe +Cc: Johannes Thumshirn +Cc: Matthew Wilcox +Cc: Miklos Szeredi +Cc: Miklos Szeredi +Cc: Theodore Ts'o +Cc: Trond Myklebust +Cc: Xiubo Li +Signed-off-by: Andrew Morton +Cc: Jan Kara +Link: https://lore.kernel.org/r/20231205122122.dfhhoaswsfscuhc3@quack3 +Signed-off-by: Greg Kroah-Hartman +--- + fs/iomap/direct-io.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +--- a/fs/iomap/direct-io.c ++++ b/fs/iomap/direct-io.c +@@ -94,7 +94,6 @@ ssize_t iomap_dio_complete(struct iomap_ + if (offset + ret > dio->i_size && + !(dio->flags & IOMAP_DIO_WRITE)) + ret = dio->i_size - offset; +- iocb->ki_pos += ret; + } + + /* +@@ -120,18 +119,19 @@ ssize_t iomap_dio_complete(struct iomap_ + } + + inode_dio_end(file_inode(iocb->ki_filp)); +- /* +- * If this is a DSYNC write, make sure we push it to stable storage now +- * that we've written data. +- */ +- if (ret > 0 && (dio->flags & IOMAP_DIO_NEED_SYNC)) +- ret = generic_write_sync(iocb, ret); +- +- if (ret > 0) +- ret += dio->done_before; ++ if (ret > 0) { ++ iocb->ki_pos += ret; + ++ /* ++ * If this is a DSYNC write, make sure we push it to stable ++ * storage now that we've written data. ++ */ ++ if (dio->flags & IOMAP_DIO_NEED_SYNC) ++ ret = generic_write_sync(iocb, ret); ++ if (ret > 0) ++ ret += dio->done_before; ++ } + kfree(dio); +- + return ret; + } + EXPORT_SYMBOL_GPL(iomap_dio_complete); diff --git a/queue-6.1/series b/queue-6.1/series index 39fd90c7a3a..ee18a32abd6 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -105,3 +105,4 @@ xen-allow-platform-pci-interrupt-to-be-shared.patch xen-simplify-evtchn_do_upcall-call-maze.patch x86-xen-fix-percpu-vcpu_info-allocation.patch x86-apic-msi-fix-misconfigured-non-maskable-msi-quirk.patch +iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch