Skip to content
  • Jimmy Durand Wesolowski's avatar
    fs: add the fsnotify call to vfs_iter_write · fb0c3321
    Jimmy Durand Wesolowski authored
    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 abbb6589 ("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 abbb6589 ("fs: implement vfs_iter_write using do_iter_write")
    * commit 18e9710e ("fs: implement vfs_iter_read using do_iter_read")
    * commit edab5fe3
      ("fs: move more code into do_iter_read/do_iter_write")
    * commit 19c73586 ("fs: remove __do_readv_writev")
    * commit 26c87fb7 ("fs: remove do_compat_readv_writev")
    * commit 251b42a1 ("fs: remove do_readv_writev")
    
    as well as the following dependencies:
    * commit bb7462b6
      ("vfs: use helpers for calling f_op->{read,write}_iter()")
    * commit 0f78d06a
      ("vfs: pass type instead of fn to do_{loop,iter}_readv_writev()")
    * commit 7687a7a4
      ("vfs: extract common parts of {compat_,}do_readv_writev()")
    
    In order to reduce the changes, this commit uses only the part of
    commit abbb6589 ("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: default avatarRichard Li <richardpku@gmail.com>
    Reported-by: default avatarChad Miller <millchad@amazon.com>
    Reviewed-by: default avatarStefan Nuernberger <snu@amazon.de>
    Reviewed-by: default avatarFrank Becker <becke@amazon.de>
    Signed-off-by: default avatarJimmy Durand Wesolowski <jdw@amazon.de>
    fb0c3321