1. 20 Feb, 2013 38 commits
  2. 15 Feb, 2013 2 commits
    • David Sterba's avatar
      btrfs: access superblock via pagecache in scan_one_device · 6f60cbd3
      David Sterba authored
      btrfs_scan_one_device is calling set_blocksize() which can race
      with a concurrent process making dirty page cache pages.  It can end up
      dropping dirty page cache pages on the floor, which isn't very nice when
      someone is just running btrfs dev scan to find filesystems on the
      box.
      
      Now that udev is registering btrfs devices as it discovers them, we can
      actually end up racing with our own mkfs program too.  When this
      happens, we drop some of the important blocks written by mkfs.
      
      This commit changes scan_one_device to read the super out of the page
      cache instead of trying to use bread.  This way we don't have to care
      about the blocksize of the device.
      
      This also drops the invalidate_bdev() call.  It wasn't very polite to
      invalidate during the scan either.  mkfs is putting the super into the
      page cache, there's no reason to invalidate at this point.
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      6f60cbd3
    • Arne Jansen's avatar
      Btrfs: fix crash in log replay with qgroups enabled · 2a745b14
      Arne Jansen authored
      When replaying a log tree with qgroups enabled, tree_mod_log_rewind does a
      sanity-check of the number of items against the maximum possible number.
      It calculates that number with the nodesize of fs_root. Unfortunately
      fs_root is not yet set at this stage. So instead use the nodesize from
      tree_root, which is already initialized.
      Signed-off-by: default avatarArne Jansen <sensille@gmx.net>
      Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
      2a745b14