]> Git Repo - linux.git/commitdiff
Merge tag 'for-5.11-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
authorLinus Torvalds <[email protected]>
Fri, 29 Jan 2021 21:54:40 +0000 (13:54 -0800)
committerLinus Torvalds <[email protected]>
Fri, 29 Jan 2021 21:54:40 +0000 (13:54 -0800)
Pull btrfs fixes from David Sterba:
 "A few more fixes for a late rc:

   - fix lockdep complaint on 32bit arches and also remove an unsafe
     memory use due to device vs filesystem lifetime

   - two fixes for free space tree:

      * race during log replay and cache rebuild, now more likely to
        happen due to changes in this dev cycle

      * possible free space tree corruption with online conversion
        during initial tree population"

* tag 'for-5.11-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: fix log replay failure due to race with space cache rebuild
  btrfs: fix lockdep warning due to seqcount_mutex on 32bit arch
  btrfs: fix possible free space tree corruption with online conversion

1  2 
fs/btrfs/ctree.h
fs/btrfs/volumes.c

diff --combined fs/btrfs/ctree.h
index e6e37591f1ded91a97c6046b1b021ecdfcab1e7c,47ca8edafb5e6e1b95a8064d79f597aca6dd8e80..4debdbdde2abbc264bf62c1a65fe31e22c9f3008
@@@ -17,6 -17,7 +17,6 @@@
  #include <linux/wait.h>
  #include <linux/slab.h>
  #include <trace/events/btrfs.h>
 -#include <asm/kmap_types.h>
  #include <asm/unaligned.h>
  #include <linux/pagemap.h>
  #include <linux/btrfs.h>
@@@ -563,6 -564,9 +563,9 @@@ enum 
  
        /* Indicate that we need to cleanup space cache v1 */
        BTRFS_FS_CLEANUP_SPACE_CACHE_V1,
+       /* Indicate that we can't trust the free space tree for caching yet */
+       BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
  };
  
  /*
diff --combined fs/btrfs/volumes.c
index 0a6de859eb2226a2283076659fffe4afd22dd32b,b900cc7849b6ab5dfe3fa23d7fc5cc5da157ed31..d6c24c8ad7499b6e16a07d2d7332feee9baf573a
@@@ -433,7 -433,7 +433,7 @@@ static struct btrfs_device *__alloc_dev
  
        atomic_set(&dev->reada_in_flight, 0);
        atomic_set(&dev->dev_stats_ccnt, 0);
-       btrfs_device_data_ordered_init(dev, fs_info);
+       btrfs_device_data_ordered_init(dev);
        INIT_RADIX_TREE(&dev->reada_zones, GFP_NOFS & ~__GFP_DIRECT_RECLAIM);
        INIT_RADIX_TREE(&dev->reada_extents, GFP_NOFS & ~__GFP_DIRECT_RECLAIM);
        extent_io_tree_init(fs_info, &dev->alloc_state,
@@@ -935,16 -935,16 +935,16 @@@ static noinline struct btrfs_device *de
                 * make sure it's the same device if the device is mounted
                 */
                if (device->bdev) {
 -                      struct block_device *path_bdev;
 +                      int error;
 +                      dev_t path_dev;
  
 -                      path_bdev = lookup_bdev(path);
 -                      if (IS_ERR(path_bdev)) {
 +                      error = lookup_bdev(path, &path_dev);
 +                      if (error) {
                                mutex_unlock(&fs_devices->device_list_mutex);
 -                              return ERR_CAST(path_bdev);
 +                              return ERR_PTR(error);
                        }
  
 -                      if (device->bdev != path_bdev) {
 -                              bdput(path_bdev);
 +                      if (device->bdev->bd_dev != path_dev) {
                                mutex_unlock(&fs_devices->device_list_mutex);
                                /*
                                 * device->fs_info may not be reliable here, so
                                                  task_pid_nr(current));
                                return ERR_PTR(-EEXIST);
                        }
 -                      bdput(path_bdev);
                        btrfs_info_in_rcu(device->fs_info,
        "devid %llu device path %s changed to %s scanned by %s (%d)",
                                          devid, rcu_str_deref(device->name),
This page took 0.093861 seconds and 4 git commands to generate.