1. 16 Sep, 2018 2 commits
    • Toshi Kani's avatar
      ext4, dax: set ext4_dax_aops for dax files · cce6c9f7
      Toshi Kani authored
      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: default avatarToshi Kani <toshi.kani@hpe.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Suggested-by: default avatarJan Kara <jack@suse.cz>
      Cc: stable@vger.kernel.org
      cce6c9f7
    • Toshi Kani's avatar
      ext4, dax: add ext4_bmap to ext4_dax_aops · 94dbb631
      Toshi Kani authored
      Ext4 mount path calls .bmap to the journal inode. This currently
      works for the DAX mount case because ext4_iget() always set
      'ext4_da_aops' to any regular files.
      
      In preparation to fix ext4_iget() to set 'ext4_dax_aops' for ext4
      DAX files, add ext4_bmap() to 'ext4_dax_aops', since bmap works for
      DAX inodes.
      
      Fixes: 5f0663bb ("ext4, dax: introduce ext4_dax_aops")
      Signed-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Suggested-by: default avatarJan Kara <jack@suse.cz>
      Cc: stable@vger.kernel.org
      94dbb631
  2. 15 Sep, 2018 2 commits
  3. 11 Sep, 2018 1 commit
  4. 04 Sep, 2018 2 commits
  5. 01 Sep, 2018 2 commits
    • Theodore Ts'o's avatar
      ext4: recalucate superblock checksum after updating free blocks/inodes · 4274f516
      Theodore Ts'o authored
      When mounting the superblock, ext4_fill_super() calculates the free
      blocks and free inodes and stores them in the superblock.  It's not
      strictly necessary, since we don't use them any more, but it's nice to
      keep them roughly aligned to reality.
      
      Since it's not critical for file system correctness, the code doesn't
      call ext4_commit_super().  The problem is that it's in
      ext4_commit_super() that we recalculate the superblock checksum.  So
      if we're not going to call ext4_commit_super(), we need to call
      ext4_superblock_csum_set() to make sure the superblock checksum is
      consistent.
      
      Most of the time, this doesn't matter, since we end up calling
      ext4_commit_super() very soon thereafter, and definitely by the time
      the file system is unmounted.  However, it doesn't work in this
      sequence:
      
      mke2fs -Fq -t ext4 /dev/vdc 128M
      mount /dev/vdc /vdc
      cp xfstests/git-versions /vdc
      godown /vdc
      umount /vdc
      mount /dev/vdc
      tune2fs -l /dev/vdc
      
      With this commit, the "tune2fs -l" no longer fails.
      Reported-by: default avatarChengguang Xu <cgxu519@gmx.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      
      
      4274f516
    • Theodore Ts'o's avatar
      ext4: avoid arithemetic overflow that can trigger a BUG · bcd8e91f
      Theodore Ts'o authored
      A maliciously crafted file system can cause an overflow when the
      results of a 64-bit calculation is stored into a 32-bit length
      parameter.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=200623Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reported-by: default avatarWen Xu <wen.xu@gatech.edu>
      Cc: stable@vger.kernel.org
      bcd8e91f
  6. 27 Aug, 2018 3 commits
  7. 04 Aug, 2018 1 commit
  8. 02 Aug, 2018 2 commits
  9. 01 Aug, 2018 2 commits
  10. 29 Jul, 2018 23 commits