From: Greg Kroah-Hartman Date: Tue, 5 Dec 2023 17:58:11 +0000 (+0900) Subject: 5.15-stable patches X-Git-Tag: v4.14.332~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=895b31a937e6ae85b4078729c743f5d12c4e247d;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch --- diff --git a/queue-5.15/iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch b/queue-5.15/iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch new file mode 100644 index 00000000000..51d49ea2b6e --- /dev/null +++ b/queue-5.15/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 +@@ -92,7 +92,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; + } + + /* +@@ -118,18 +117,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-5.15/series b/queue-5.15/series index 0d3d4f04c4d..fae6b4860dc 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -65,3 +65,4 @@ mmc-core-add-helpers-mmc_regulator_enable-disable_vq.patch mmc-sdhci-sprd-fix-vqmmc-not-shutting-down-after-the.patch r8169-disable-aspm-in-case-of-tx-timeout.patch r8169-fix-deadlock-on-rtl8125-in-jumbo-mtu-mode.patch +iomap-update-ki_pos-a-little-later-in-iomap_dio_complete.patch