From: Greg Kroah-Hartman Date: Thu, 31 Jan 2019 15:07:24 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v4.20.7~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34592ee8da7f7c87b2c43b8142e67453c7ceffa8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: fs-add-the-fsnotify-call-to-vfs_iter_write.patch --- diff --git a/queue-4.4/fs-add-the-fsnotify-call-to-vfs_iter_write.patch b/queue-4.4/fs-add-the-fsnotify-call-to-vfs_iter_write.patch new file mode 100644 index 00000000000..ffdb1105635 --- /dev/null +++ b/queue-4.4/fs-add-the-fsnotify-call-to-vfs_iter_write.patch @@ -0,0 +1,67 @@ +From jdw@amazon.de Thu Jan 31 16:05:54 2019 +From: Jimmy Durand Wesolowski +Date: Thu, 31 Jan 2019 15:19:39 +0100 +Subject: fs: add the fsnotify call to vfs_iter_write +To: stable@vger.kernel.org +Cc: David Woodhouse , Amit Shah , Stefan Nuernberger , Frank Becker , Jimmy Durand Wesolowski +Message-ID: <1548944379-21257-1-git-send-email-jdw@amazon.de> + +From: Jimmy Durand Wesolowski + +A bug has been discovered when redirecting splice output to regular files +on EXT4 and tmpfs. Other filesystems might be affected. +This commit fixes the issue for stable series kernel, using one of the +change introduced during the rewrite and refactoring of vfs_iter_write in +4.13, specifically in the +commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write"). + +This issue affects v4.4 and v4.9 stable series of kernels. + +Without this fix for v4.4 and v4.9 stable, the following upstream commits +(and their dependencies would need to be backported): +* commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write") +* commit 18e9710ee59c ("fs: implement vfs_iter_read using do_iter_read") +* commit edab5fe38c2c + ("fs: move more code into do_iter_read/do_iter_write") +* commit 19c735868dd0 ("fs: remove __do_readv_writev") +* commit 26c87fb7d10d ("fs: remove do_compat_readv_writev") +* commit 251b42a1dc64 ("fs: remove do_readv_writev") + +as well as the following dependencies: +* commit bb7462b6fd64 + ("vfs: use helpers for calling f_op->{read,write}_iter()") +* commit 0f78d06ac1e9 + ("vfs: pass type instead of fn to do_{loop,iter}_readv_writev()") +* commit 7687a7a4435f + ("vfs: extract common parts of {compat_,}do_readv_writev()") + +In order to reduce the changes, this commit uses only the part of +commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write") +that fixes the issue. + +This issue and the reproducer can be found on +https://bugzilla.kernel.org/show_bug.cgi?id=85381 + +Reported-by: Richard Li +Reported-by: Chad Miller +Reviewed-by: Stefan Nuernberger +Reviewed-by: Frank Becker +Signed-off-by: Jimmy Durand Wesolowski +--- + fs/read_write.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/fs/read_write.c ++++ b/fs/read_write.c +@@ -363,8 +363,10 @@ ssize_t vfs_iter_write(struct file *file + iter->type |= WRITE; + ret = file->f_op->write_iter(&kiocb, iter); + BUG_ON(ret == -EIOCBQUEUED); +- if (ret > 0) ++ if (ret > 0) { + *ppos = kiocb.ki_pos; ++ fsnotify_modify(file); ++ } + return ret; + } + EXPORT_SYMBOL(vfs_iter_write); diff --git a/queue-4.4/series b/queue-4.4/series index 6cbd3a3f1bb..73d4be3f1b1 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -30,3 +30,4 @@ f2fs-read-page-index-before-freeing.patch 0002-Revert-loop-Get-rid-of-loop_index_mutex.patch 0003-Revert-loop-Fold-__loop_release-into-loop_release.patch s390-smp-fix-calling-smp_call_ipl_cpu-from-ipl-cpu.patch +fs-add-the-fsnotify-call-to-vfs_iter_write.patch