• Toshi Kani's avatar
    ext4, dax: set ext4_dax_aops for dax files · ec215095
    Toshi Kani authored
    commit cce6c9f7 upstream.
    
    Sync syscall to DAX file needs to flush processor cache, but it
    currently does not flush to existing DAX files.  This is because
    'ext4_da_aops' is set to address_space_operations of existing DAX
    files, instead of 'ext4_dax_aops', since S_DAX flag is set after
    ext4_set_aops() in the open path.
    
      New file
      --------
      lookup_open
        ext4_create
          __ext4_new_inode
            ext4_set_inode_flags   // Set S_DAX flag
          ext4_set_aops            // Set aops to ext4_dax_aops
    
      Existing file
      -------------
      lookup_open
        ext4_lookup
          ext4_iget
            ext4_set_aops          // Set aops to ext4_da_aops
            ext4_set_inode_flags   // Set S_DAX flag
    
    Change ext4_iget() to initialize i_flags before ext4_set_aops().
    
    Fixes: 5f0663bb ("ext4, dax: introduce ext4_dax_aops")
    Signed-off-by: 's avatarToshi Kani <toshi.kani@hpe.com>
    Signed-off-by: 's avatarTheodore Ts'o <tytso@mit.edu>
    Suggested-by: 's avatarJan Kara <jack@suse.cz>
    Cc: stable@vger.kernel.org
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ec215095
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
acl.c Loading commit data...
acl.h Loading commit data...
balloc.c Loading commit data...
bitmap.c Loading commit data...
block_validity.c Loading commit data...
dir.c Loading commit data...
ext4.h Loading commit data...
ext4_extents.h Loading commit data...
ext4_jbd2.c Loading commit data...
ext4_jbd2.h Loading commit data...
extents.c Loading commit data...
extents_status.c Loading commit data...
extents_status.h Loading commit data...
file.c Loading commit data...
fsmap.c Loading commit data...
fsmap.h Loading commit data...
fsync.c Loading commit data...
hash.c Loading commit data...
ialloc.c Loading commit data...
indirect.c Loading commit data...
inline.c Loading commit data...
inode.c Loading commit data...
ioctl.c Loading commit data...
mballoc.c Loading commit data...
mballoc.h Loading commit data...
migrate.c Loading commit data...
mmp.c Loading commit data...
move_extent.c Loading commit data...
namei.c Loading commit data...
page-io.c Loading commit data...
readpage.c Loading commit data...
resize.c Loading commit data...
super.c Loading commit data...
symlink.c Loading commit data...
sysfs.c Loading commit data...
truncate.h Loading commit data...
xattr.c Loading commit data...
xattr.h Loading commit data...
xattr_security.c Loading commit data...
xattr_trusted.c Loading commit data...
xattr_user.c Loading commit data...