1. 21 2月, 2013 4 次提交
  2. 20 2月, 2013 1 次提交
  3. 16 2月, 2013 1 次提交
    • D
      btrfs: access superblock via pagecache in scan_one_device · 6f60cbd3
      David Sterba 提交于
      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: NDavid Sterba <dsterba@suse.cz>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      6f60cbd3
  4. 02 2月, 2013 1 次提交
  5. 25 1月, 2013 1 次提交
  6. 22 1月, 2013 1 次提交
  7. 20 1月, 2013 1 次提交
    • I
      Btrfs: bring back balance pause/resume logic · ed0fb78f
      Ilya Dryomov 提交于
      Balance pause/resume logic got broken by 5ac00add (went in into 3.8-rc1
      as part of dev-replace merge).  Offending commit took a stab at making
      mutually exclusive volume operations (add_dev, rm_dev, resize, balance,
      replace_dev) not block behind volume_mutex if another such operation is
      in progress and instead return an error right away.  Balancing front-end
      relied on the blocking behaviour, so the fix is ugly, but short of a
      complete rework, it's the best we can do.
      Reported-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      ed0fb78f
  8. 15 1月, 2013 1 次提交
  9. 17 12月, 2012 4 次提交
    • L
      Btrfs: put raid properties into global table · 31e50229
      Liu Bo 提交于
      Raid properties can be shared among raid calculation code, we can put
      them into a global table to keep it simple.
      Signed-off-by: NLiu Bo <bo.li.liu@oracle.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      31e50229
    • J
      Btrfs: log changed inodes based on the extent map tree · 70c8a91c
      Josef Bacik 提交于
      We don't really need to copy extents from the source tree since we have all
      of the information already available to us in the extent_map tree.  So
      instead just write the extents straight to the log tree and don't bother to
      copy the extent items from the source tree.
      Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      70c8a91c
    • L
      btrfs: Notify udev when removing device · b8b8ff59
      Lukas Czerner 提交于
      Currently udev does not know about the device being removed from the
      file system. This may result in the situation where we're unable to
      mount the file system by UUID or by LABEL because the by-uuid and
      by-label links may still point to the device which is no longer part of
      the btrfs file system and hence does not have any btrfs super block.
      
      It can be easily reproduced by the following:
      
      mkfs.btrfs -L bugfs /dev/loop[0-6]
      mount /dev/loop0 /mnt/test
      btrfs device delete /dev/loop0 /mnt/test
      umount /mnt/test
      
      mount LABEL=bugfs /mnt/test <---- this fails
      
      then see:
      
      ls -l /dev/disk/by-label/bugfs
      
      which will still point to the /dev/loop0
      
      We did not noticed this before because libblkid would send the udev
      event for us when it notice that the link does not fit the reality,
      however it does not do that anymore and completely relies on udev
      information.
      
      Fix this by sending the KOBJ_CHANGE event to the bdev kobject after
      successful device removal.
      
      Note that this does not affect device addition, because we will open the
      device prior the addition from userspace and udev will notice that and
      reread the device afterwards.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      b8b8ff59
    • S
      Btrfs: fix a build warning for an unused label · f9c83748
      Stefan Behrens 提交于
      This issue was detected by the "0-DAY kernel build testing".
      
      fs/btrfs/volumes.c: In function 'btrfs_rm_device':
      fs/btrfs/volumes.c:1505:1: warning: label 'error_close' defined but not used [-Wunused-label]
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      Signed-off-by: NChris Mason <chris.mason@fusionio.com>
      f9c83748
  10. 13 12月, 2012 20 次提交
  11. 12 12月, 2012 2 次提交
  12. 26 10月, 2012 1 次提交
    • M
      Btrfs: fix deadlock caused by the nested chunk allocation · 671415b7
      Miao Xie 提交于
      Steps to reproduce:
       # mkfs.btrfs -m raid1 <disk1> <disk2>
       # btrfstune -S 1 <disk1>
       # mount <disk1> <mnt>
       # btrfs device add <disk3> <disk4> <mnt>
       # mount -o remount,rw <mnt>
       # dd if=/dev/zero of=<mnt>/tmpfile bs=1M count=1
       Deadlock happened.
      
      It is because of the nested chunk allocation. When we wrote the data
      into the filesystem, we would allocate the data chunk because there was
      no data chunk in the filesystem. At the end of the data chunk allocation,
      we should insert the metadata of the data chunk into the extent tree, but
      there was no raid1 chunk, so we tried to lock the chunk allocation mutex to
      allocate the new chunk, but we had held the mutex, the deadlock happened.
      
      By rights, we would allocate the raid1 chunk when we added the second device
      because the profile of the seed filesystem is raid1 and we had two devices.
      But we didn't do that in fact. It is because the last step of the first device
      insertion didn't commit the transaction. So when we added the second device,
      we didn't cow the tree, and just inserted the relative metadata into the leaves
      which were generated by the first device insertion, and its profile was dup.
      
      So, I fix this problem by commiting the transaction at the end of the first
      device insertion.
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      671415b7
  13. 09 10月, 2012 2 次提交
    • S
      Btrfs: make filesystem read-only when submitting barrier fails · 5af3e8cc
      Stefan Behrens 提交于
      So far the return code of barrier_all_devices() is ignored, which
      means that errors are ignored. The result can be a corrupt
      filesystem which is not consistent.
      This commit adds code to evaluate the return code of
      barrier_all_devices(). The normal btrfs_error() mechanism is used to
      switch the filesystem into read-only mode when errors are detected.
      
      In order to decide whether barrier_all_devices() should return
      error or success, the number of disks that are allowed to fail the
      barrier submission is calculated. This calculation accounts for the
      worst RAID level of metadata, system and data. If single, dup or
      RAID0 is in use, a single disk error is already considered to be
      fatal. Otherwise a single disk error is tolerated.
      
      The calculation of the number of disks that are tolerated to fail
      the barrier operation is performed when the filesystem gets mounted,
      when a balance operation is started and finished, and when devices
      are added or removed.
      Signed-off-by: NStefan Behrens <sbehrens@giantdisaster.de>
      5af3e8cc
    • D
      btrfs: fix message printing · 48940662
      Daniel J Blueman 提交于
      Fix various messages to include newline and module prefix.
      Signed-off-by: NDaniel J Blueman <daniel@quora.org>
      48940662