1. 30 5月, 2018 1 次提交
    • O
      Btrfs: fix clone vs chattr NODATASUM race · b5c40d59
      Omar Sandoval 提交于
      In btrfs_clone_files(), we must check the NODATASUM flag while the
      inodes are locked. Otherwise, it's possible that btrfs_ioctl_setflags()
      will change the flags after we check and we can end up with a party
      checksummed file.
      
      The race window is only a few instructions in size, between the if and
      the locks which is:
      
      3834         if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode))
      3835                 return -EISDIR;
      
      where the setflags must be run and toggle the NODATASUM flag (provided
      the file size is 0).  The clone will block on the inode lock, segflags
      takes the inode lock, changes flags, releases log and clone continues.
      
      Not impossible but still needs a lot of bad luck to hit unintentionally.
      
      Fixes: 0e7b824c ("Btrfs: don't make a file partly checksummed through file clone")
      CC: stable@vger.kernel.org # 4.4+
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Reviewed-by: NNikolay Borisov <nborisov@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      [ update changelog ]
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      b5c40d59
  2. 29 5月, 2018 24 次提交
  3. 28 5月, 2018 1 次提交
  4. 12 4月, 2018 1 次提交
  5. 31 3月, 2018 5 次提交
  6. 26 3月, 2018 2 次提交
  7. 20 3月, 2018 1 次提交
  8. 29 1月, 2018 1 次提交
    • J
      fs: new API for handling inode->i_version · ae5e165d
      Jeff Layton 提交于
      Add a documentation blob that explains what the i_version field is, how
      it is expected to work, and how it is currently implemented by various
      filesystems.
      
      We already have inode_inc_iversion. Add several other functions for
      manipulating and accessing the i_version counter. For now, the
      implementation is trivial and basically works the way that all of the
      open-coded i_version accesses work today.
      
      Future patches will convert existing users of i_version to use the new
      API, and then convert the backend implementation to do things more
      efficiently.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      ae5e165d
  9. 22 1月, 2018 4 次提交