]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 3 Mar 2013 00:41:54 +0000 (16:41 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 3 Mar 2013 00:41:54 +0000 (16:41 -0800)
Pull btrfs update from Chris Mason:
 "The biggest feature in the pull is the new (and still experimental)
  raid56 code that David Woodhouse started long ago.  I'm still working
  on the parity logging setup that will avoid inconsistent parity after
  a crash, so this is only for testing right now.  But, I'd really like
  to get it out to a broader audience to hammer out any performance
  issues or other problems.

  scrub does not yet correct errors on raid5/6 either.

  Josef has another pass at fsync performance.  The big change here is
  to combine waiting for metadata with waiting for data, which is a big
  latency win.  It is also step one toward using atomics from the
  hardware during a commit.

  Mark Fasheh has a new way to use btrfs send/receive to send only the
  metadata changes.  SUSE is using this to make snapper more efficient
  at finding changes between snapshosts.

  Snapshot-aware defrag is also included.

  Otherwise we have a large number of fixes and cleanups.  Eric Sandeen
  wins the award for removing the most lines, and I'm hoping we steal
  this idea from XFS over and over again."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (118 commits)
  btrfs: fixup/remove module.h usage as required
  Btrfs: delete inline extents when we find them during logging
  btrfs: try harder to allocate raid56 stripe cache
  Btrfs: cleanup to make the function btrfs_delalloc_reserve_metadata more logic
  Btrfs: don't call btrfs_qgroup_free if just btrfs_qgroup_reserve fails
  Btrfs: remove reduplicate check about root in the function btrfs_clean_quota_tree
  Btrfs: return ENOMEM rather than use BUG_ON when btrfs_alloc_path fails
  Btrfs: fix missing deleted items in btrfs_clean_quota_tree
  btrfs: use only inline_pages from extent buffer
  Btrfs: fix wrong reserved space when deleting a snapshot/subvolume
  Btrfs: fix wrong reserved space in qgroup during snap/subv creation
  Btrfs: remove unnecessary dget_parent/dput when creating the pending snapshot
  btrfs: remove a printk from scan_one_device
  Btrfs: fix NULL pointer after aborting a transaction
  Btrfs: fix memory leak of log roots
  Btrfs: copy everything if we've created an inline extent
  btrfs: cleanup for open-coded alignment
  Btrfs: do not change inode flags in rename
  Btrfs: use reserved space for creating a snapshot
  clear chunk_alloc flag on retryable failure
  ...

1  2 
fs/btrfs/Kconfig
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/relocation.c
fs/btrfs/send.c
fs/btrfs/transaction.c

Simple merge
index cf54bdfee334287383e7b63badc5a3683e2edf4f,aaee2b7fee78ee66c9479f05ca1993c227214712..3e074dab2d57a3e39ad16538f7a51bfde8e4ed91
@@@ -3689,6 -3800,45 +3800,28 @@@ static int can_overcommit(struct btrfs_
        return 0;
  }
  
 -static inline int writeback_inodes_sb_nr_if_idle_safe(struct super_block *sb,
 -                                                    unsigned long nr_pages,
 -                                                    enum wb_reason reason)
 -{
 -      /* the flusher is dealing with the dirty inodes now. */
 -      if (writeback_in_progress(sb->s_bdi))
 -              return 1;
 -
 -      if (down_read_trylock(&sb->s_umount)) {
 -              writeback_inodes_sb_nr(sb, nr_pages, reason);
 -              up_read(&sb->s_umount);
 -              return 1;
 -      }
 -
 -      return 0;
 -}
 -
+ void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root,
+                                 unsigned long nr_pages)
+ {
+       struct super_block *sb = root->fs_info->sb;
+       int started;
+       /* If we can not start writeback, just sync all the delalloc file. */
 -      started = writeback_inodes_sb_nr_if_idle_safe(sb, nr_pages,
++      started = try_to_writeback_inodes_sb_nr(sb, nr_pages,
+                                                     WB_REASON_FS_FREE_SPACE);
+       if (!started) {
+               /*
+                * We needn't worry the filesystem going from r/w to r/o though
+                * we don't acquire ->s_umount mutex, because the filesystem
+                * should guarantee the delalloc inodes list be empty after
+                * the filesystem is readonly(all dirty pages are written to
+                * the disk).
+                */
+               btrfs_start_delalloc_inodes(root, 0);
+               btrfs_wait_ordered_extents(root, 0);
+       }
+ }
  /*
   * shrink metadata reservation for delalloc
   */
diff --cc fs/btrfs/file.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/btrfs/send.c
Simple merge
index 4c0067c4f76dd6d9564e8a4dd1cc2d30aa57e4ba,f11c2e0a37465e989eaacca2111fbb99753ac3c1..e52da6fb11659e3b1b893086581b7c5a85d8eeb6
@@@ -112,8 -123,9 +123,8 @@@ loop
                 * to redo the trans_no_join checks above
                 */
                kmem_cache_free(btrfs_transaction_cachep, cur_trans);
 -              cur_trans = fs_info->running_transaction;
                goto loop;
-       } else if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) {
+       } else if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
                spin_unlock(&fs_info->trans_lock);
                kmem_cache_free(btrfs_transaction_cachep, cur_trans);
                return -EROFS;