On 03/31/2012 01:51 AM, Chris Mason wrote:
Hi everyone,
This pull request is pretty big, picking up patches that have been under
development for some time. I have it in two branches:
# against 3.3
#
git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus
# merged with linus git as of this morning (conflict in fs/btrfs/scrub.c)
#
git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git
for-linus-merged
The conflict resolution was to pick my version of scrub.c and then go in
and drop all the KM_ args from kmap/unmap_atomic.
We've merged in the error handling patches from SuSE. These are already
shipping in the sles kernel, and they give btrfs the ability to abort
transactions and go readonly on errors. It involves a lot of churn as
they clarify BUG_ONs, and remove the ones we now properly deal with.
Josef reworked the way our metadata interacts with the page cache.
page-private now points to the btrfs extent_buffer object, which makes
everything faster. He changed it so we write an whole extent buffer at
a time instead of allowing individual pages to go down,, which will be
important for the raid5/6 code (for the 3.5 merge window ;)
Josef also made us more aggressive about dropping pages for metadata
blocks that were freed due to COW. Overall, our metadata caching is
much faster now.
We've integrated my patch for metadata bigger than the page size. This
allows metadata blocks up to 64KB in size. In practice 16K and 32K seem
to work best. For workloads with lots of metadata, this cuts down the
size of the extent allocation tree dramatically and fragments much less.
We still suffer pains in using a sectorsize larger than PAGE_SIZE, so
we'd better add a checker for it, something like:
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 20196f4..08e49d2 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2104,6 +2104,14 @@ int open_ctree(struct super_block *sb,
err = -EINVAL;
goto fail_alloc;
}
+ if (btrfs_super_sectorsize(disk_super) PAGE_CACHE_SIZE) {
+ printk(KERN_ERR BTRFS: couldn't mount because sectorsize(%d)
+ was larger than PAGE_SIZE(%lu)\n,
+ btrfs_super_sectorsize(disk_super),
+ (unsigned long long)PAGE_CACHE_SIZE);
+ err = -EINVAL;
+ goto fail_alloc;
+ }
features = btrfs_super_incompat_flags(disk_super);
features |= BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF;
--
1.6.5.2
thanks,
liubo
Scrub was updated to support the larger block sizes, which ended up
being a fairly large change (thanks Stefan Behrens).
We also have an assortment of fixes and updates, especially to the
balancing code (Ilya Dryomov), the back ref walker (Jan Schmidt) and the
defragging code (Liu Bo).
Jeff Mahoney (21) commits (+1982/-1051):
btrfs: clean_tree_block should panic on observed memory corruption and
return void (+12/-7)
btrfs: avoid NULL deref in btrfs_reserve_extent with DEBUG_ENOSPC (+2/-1)
btrfs: Catch locking failures in {set,clear,convert}_extent_bit (+38/-20)
btrfs: return void in functions without error conditions (+293/-410)
btrfs: replace many BUG_ONs with proper error handling (+980/-385)
btrfs: Remove set bits return from clear_extent_bit (+5/-7)
btrfs: enhance transaction abort infrastructure (+300/-56)
btrfs: Factor out tree-ops-merge_bio_hook call (+17/-5)
btrfs: Fix kfree of member instead of structure (+3/-3)
btrfs: btrfs_drop_snapshot should return int (+12/-8)
btrfs: -submit_bio_hook error push-up (+31/-15)
btrfs: find_and_setup_root error push-up (+6/-5)
btrfs: __add_reloc_root error push-up (+16/-6)
btrfs: btrfs_update_root error push-up (+7/-4)
btrfs: Panic on bad rbtree operations (+39/-9)
btrfs: Simplify btrfs_submit_bio_hook (+4/-3)
btrfs: drop gfp_t from lock_extent (+63/-76)
btrfs: add varargs to btrfs_error (+66/-9)
btrfs: Simplify btrfs_insert_root (+3/-6)
btrfs: split extent_state ops (+25/-15)
btrfs: Add btrfs_panic() (+60/-1)
Ilya Dryomov (11) commits (+177/-159):
Btrfs: validate target profiles only if we are going to use them (+11/-16)
Btrfs: stop silently switching single chunks to raid0 on balance (+2/-3)
Btrfs: add wrappers for working with alloc profiles (+30/-30)
Btrfs: move alloc_profile_is_valid() to volumes.c (+25/-30)
Btrfs: make profile_is_valid() check more strict (+17/-12)
Btrfs: fix infinite loop in btrfs_shrink_device() (+2/-3)
Btrfs: improve the logic in btrfs_can_relocate() (+18/-6)
Btrfs: allow dup for data chunks in mixed mode (+9/-4)
Btrfs: add __get_block_group_index() helper (+12/-5)
Btrfs: add get_restripe_target() helper (+50/-44)
Btrfs: fix memory leak in resolver code (+1/-6)
Mark Fasheh (10) commits (+60/-19):