Merge branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Feb 2017 17:15:58 +0000 (09:15 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 11 Feb 2017 17:15:58 +0000 (09:15 -0800)
Pull btrfs fixes from Chris Mason:
 "This has two last minute fixes. The highest priority here is a
  regression fix for the decompression code, but we also fixed up a
  problem with the 32-bit compat ioctls.

  The decompression bug could hand back the wrong data on big reads when
  zlib was used. I have a larger cleanup to make the math here less
  error prone, but at this stage in the release Omar's patch is the best
  choice"

* 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  btrfs: fix btrfs_decompress_buf2page()
  btrfs: fix btrfs_compat_ioctl failures on non-compat ioctls

1  2 
fs/btrfs/ioctl.c

diff --combined fs/btrfs/ioctl.c
index 33f967d30b2ad1d555015baea2bccc5eba05d1d5,0c77cad89e87f8d0f30dfb6e782b3d12a2cfe6e6..21e51b0ba188a37be6b71cab9218a8b9457b86f8
@@@ -834,7 -834,7 +834,7 @@@ static inline int btrfs_may_create(stru
   * sys_mkdirat and vfs_mkdir, but we only do a single component lookup
   * inside this filesystem so it's quite a bit simpler.
   */
 -static noinline int btrfs_mksubvol(struct path *parent,
 +static noinline int btrfs_mksubvol(const struct path *parent,
                                   char *name, int namelen,
                                   struct btrfs_root *snap_src,
                                   u64 *async_transid, bool readonly,
@@@ -3987,6 -3987,18 +3987,6 @@@ out_unlock
        return ret;
  }
  
 -ssize_t btrfs_copy_file_range(struct file *file_in, loff_t pos_in,
 -                            struct file *file_out, loff_t pos_out,
 -                            size_t len, unsigned int flags)
 -{
 -      ssize_t ret;
 -
 -      ret = btrfs_clone_files(file_out, file_in, pos_in, len, pos_out);
 -      if (ret == 0)
 -              ret = len;
 -      return ret;
 -}
 -
  int btrfs_clone_file_range(struct file *src_file, loff_t off,
                struct file *dst_file, loff_t destoff, u64 len)
  {
@@@ -5653,6 -5665,10 +5653,10 @@@ long btrfs_ioctl(struct file *file, uns
  #ifdef CONFIG_COMPAT
  long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  {
+       /*
+        * These all access 32-bit values anyway so no further
+        * handling is necessary.
+        */
        switch (cmd) {
        case FS_IOC32_GETFLAGS:
                cmd = FS_IOC_GETFLAGS;
        case FS_IOC32_GETVERSION:
                cmd = FS_IOC_GETVERSION;
                break;
-       default:
-               return -ENOIOCTLCMD;
        }
  
        return btrfs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));