]> Git Repo - linux.git/commitdiff
Merge tag 'for-5.9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
authorLinus Torvalds <[email protected]>
Thu, 13 Aug 2020 19:26:18 +0000 (12:26 -0700)
committerLinus Torvalds <[email protected]>
Thu, 13 Aug 2020 19:26:18 +0000 (12:26 -0700)
Pull more btrfs updates from David Sterba:
 "One minor update, the rest are fixes that have arrived a bit late for
  the first batch. There are also some recent fixes for bugs that were
  discovered during the merge window and pop up during testing.

  User visible change:

   - show correct subvolume path in /proc/mounts for bind mounts

  Fixes:

   - fix compression messages when remounting with different level or
     compression algorithm

   - tree-log: fix some memory leaks on error handling paths

   - restore I_VERSION on remount

   - fix return values and error code mixups

   - fix umount crash with quotas enabled when removing sysfs files

   - fix trim range on a shrunk device"

* tag 'for-5.9-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: trim: fix underflow in trim length to prevent access beyond device boundary
  btrfs: fix return value mixup in btrfs_get_extent
  btrfs: sysfs: fix NULL pointer dereference at btrfs_sysfs_del_qgroups()
  btrfs: check correct variable after allocation in btrfs_backref_iter_alloc
  btrfs: make sure SB_I_VERSION doesn't get unset by remount
  btrfs: fix memory leaks after failure to lookup checksums during inode logging
  btrfs: don't show full path of bind mounts in subvol=
  btrfs: fix messages after changing compression level by remount
  btrfs: only search for left_info if there is no right_info in try_merge_free_space
  btrfs: inode: fix NULL pointer dereference if inode doesn't need compression

1  2 
fs/btrfs/inode.c

diff --combined fs/btrfs/inode.c
index 6dc03bab0c9d1b51c3f8572d046c8ac4b49560c3,16ce82039dcf143eff5a4c93d3c30b2d3ee3fcd1..51fcd82d41c0ebec1fceb671dc23e40492941e6f
@@@ -3,7 -3,6 +3,7 @@@
   * Copyright (C) 2007 Oracle.  All rights reserved.
   */
  
 +#include <crypto/hash.h>
  #include <linux/kernel.h>
  #include <linux/bio.h>
  #include <linux/buffer_head.h>
@@@ -654,12 -653,18 +654,18 @@@ cont
                                                     page_error_op |
                                                     PAGE_END_WRITEBACK);
  
-                       for (i = 0; i < nr_pages; i++) {
-                               WARN_ON(pages[i]->mapping);
-                               put_page(pages[i]);
+                       /*
+                        * Ensure we only free the compressed pages if we have
+                        * them allocated, as we can still reach here with
+                        * inode_need_compress() == false.
+                        */
+                       if (pages) {
+                               for (i = 0; i < nr_pages; i++) {
+                                       WARN_ON(pages[i]->mapping);
+                                       put_page(pages[i]);
+                               }
+                               kfree(pages);
                        }
-                       kfree(pages);
                        return 0;
                }
        }
@@@ -6622,7 -6627,7 +6628,7 @@@ struct extent_map *btrfs_get_extent(str
            extent_type == BTRFS_FILE_EXTENT_PREALLOC) {
                /* Only regular file could have regular/prealloc extent */
                if (!S_ISREG(inode->vfs_inode.i_mode)) {
-                       ret = -EUCLEAN;
+                       err = -EUCLEAN;
                        btrfs_crit(fs_info,
                "regular/prealloc extent found for non-regular inode %llu",
                                   btrfs_ino(inode));
This page took 0.058606 seconds and 4 git commands to generate.