diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-11 12:22:21 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-11 12:22:21 -0400 |
| commit | 859862ddd2b6b8dee00498c015ab37f02474b442 (patch) | |
| tree | b5597dd52b2e596401522bab802ca7993c1c20be | |
| parent | 412dd3a6daf0cadce1b2d6a34fa3713f40255579 (diff) | |
| parent | c7548af69d9ef71512eb52d8009521eba3e768fd (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs updates from Chris Mason:
"The biggest change here is Josef's rework of the btrfs quota
accounting, which improves the in-memory tracking of delayed extent
operations.
I had been working on Btrfs stack usage for a while, mostly because it
had become impossible to do long stress runs with slab, lockdep and
pagealloc debugging turned on without blowing the stack. Even though
you upgraded us to a nice king sized stack, I kept most of the
patches.
We also have some very hard to find corruption fixes, an awesome sysfs
use after free, and the usual assortment of optimizations, cleanups
and other fixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (80 commits)
Btrfs: convert smp_mb__{before,after}_clear_bit
Btrfs: fix scrub_print_warning to handle skinny metadata extents
Btrfs: make fsync work after cloning into a file
Btrfs: use right type to get real comparison
Btrfs: don't check nodes for extent items
Btrfs: don't release invalid page in btrfs_page_exists_in_range()
Btrfs: make sure we retry if page is a retriable exception
Btrfs: make sure we retry if we couldn't get the page
btrfs: replace EINVAL with EOPNOTSUPP for dev_replace raid56
trivial: fs/btrfs/ioctl.c: fix typo s/substract/subtract/
Btrfs: fix leaf corruption after __btrfs_drop_extents
Btrfs: ensure btrfs_prev_leaf doesn't miss 1 item
Btrfs: fix clone to deal with holes when NO_HOLES feature is enabled
btrfs: free delayed node outside of root->inode_lock
btrfs: replace EINVAL with ERANGE for resize when ULLONG_MAX
Btrfs: fix transaction leak during fsync call
btrfs: Avoid trucating page or punching hole in a already existed hole.
Btrfs: update commit root on snapshot creation after orphan cleanup
Btrfs: ioctl, don't re-lock extent range when not necessary
Btrfs: avoid visiting all extent items when cloning a range
...
47 files changed, 3700 insertions, 1305 deletions
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index f341a98031d2..6d1d0b93b1aa 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile | |||
| @@ -16,4 +16,4 @@ btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o | |||
| 16 | 16 | ||
| 17 | btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/free-space-tests.o \ | 17 | btrfs-$(CONFIG_BTRFS_FS_RUN_SANITY_TESTS) += tests/free-space-tests.o \ |
| 18 | tests/extent-buffer-tests.o tests/btrfs-tests.o \ | 18 | tests/extent-buffer-tests.o tests/btrfs-tests.o \ |
| 19 | tests/extent-io-tests.o tests/inode-tests.o | 19 | tests/extent-io-tests.o tests/inode-tests.o tests/qgroup-tests.o |
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index ff9b3995d453..9a0124a95851 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -79,13 +79,6 @@ static int __btrfs_set_acl(struct btrfs_trans_handle *trans, | |||
| 79 | const char *name; | 79 | const char *name; |
| 80 | char *value = NULL; | 80 | char *value = NULL; |
| 81 | 81 | ||
| 82 | if (acl) { | ||
| 83 | ret = posix_acl_valid(acl); | ||
| 84 | if (ret < 0) | ||
| 85 | return ret; | ||
| 86 | ret = 0; | ||
| 87 | } | ||
| 88 | |||
| 89 | switch (type) { | 82 | switch (type) { |
| 90 | case ACL_TYPE_ACCESS: | 83 | case ACL_TYPE_ACCESS: |
| 91 | name = POSIX_ACL_XATTR_ACCESS; | 84 | name = POSIX_ACL_XATTR_ACCESS; |
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 10db21fa0926..e25564bfcb46 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
| @@ -900,7 +900,11 @@ again: | |||
| 900 | goto out; | 900 | goto out; |
| 901 | BUG_ON(ret == 0); | 901 | BUG_ON(ret == 0); |
| 902 | 902 | ||
| 903 | #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS | ||
| 904 | if (trans && likely(trans->type != __TRANS_DUMMY)) { | ||
| 905 | #else | ||
| 903 | if (trans) { | 906 | if (trans) { |
| 907 | #endif | ||
| 904 | /* | 908 | /* |
| 905 | * look if there are updates for this ref queued and lock the | 909 | * look if there are updates for this ref queued and lock the |
| 906 | * head | 910 | * head |
| @@ -984,11 +988,12 @@ again: | |||
| 984 | goto out; | 988 | goto out; |
| 985 | } | 989 | } |
| 986 | if (ref->count && ref->parent) { | 990 | if (ref->count && ref->parent) { |
| 987 | if (extent_item_pos && !ref->inode_list) { | 991 | if (extent_item_pos && !ref->inode_list && |
| 992 | ref->level == 0) { | ||
| 988 | u32 bsz; | 993 | u32 bsz; |
| 989 | struct extent_buffer *eb; | 994 | struct extent_buffer *eb; |
| 990 | bsz = btrfs_level_size(fs_info->extent_root, | 995 | bsz = btrfs_level_size(fs_info->extent_root, |
| 991 | info_level); | 996 | ref->level); |
| 992 | eb = read_tree_block(fs_info->extent_root, | 997 | eb = read_tree_block(fs_info->extent_root, |
| 993 | ref->parent, bsz, 0); | 998 | ref->parent, bsz, 0); |
| 994 | if (!eb || !extent_buffer_uptodate(eb)) { | 999 | if (!eb || !extent_buffer_uptodate(eb)) { |
| @@ -1404,9 +1409,10 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical, | |||
| 1404 | * returns <0 on error | 1409 | * returns <0 on error |
| 1405 | */ | 1410 | */ |
| 1406 | static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, | 1411 | static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, |
| 1407 | struct btrfs_extent_item *ei, u32 item_size, | 1412 | struct btrfs_key *key, |
| 1408 | struct btrfs_extent_inline_ref **out_eiref, | 1413 | struct btrfs_extent_item *ei, u32 item_size, |
| 1409 | int *out_type) | 1414 | struct btrfs_extent_inline_ref **out_eiref, |
| 1415 | int *out_type) | ||
| 1410 | { | 1416 | { |
| 1411 | unsigned long end; | 1417 | unsigned long end; |
| 1412 | u64 flags; | 1418 | u64 flags; |
| @@ -1416,19 +1422,26 @@ static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, | |||
| 1416 | /* first call */ | 1422 | /* first call */ |
| 1417 | flags = btrfs_extent_flags(eb, ei); | 1423 | flags = btrfs_extent_flags(eb, ei); |
| 1418 | if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { | 1424 | if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { |
| 1419 | info = (struct btrfs_tree_block_info *)(ei + 1); | 1425 | if (key->type == BTRFS_METADATA_ITEM_KEY) { |
| 1420 | *out_eiref = | 1426 | /* a skinny metadata extent */ |
| 1421 | (struct btrfs_extent_inline_ref *)(info + 1); | 1427 | *out_eiref = |
| 1428 | (struct btrfs_extent_inline_ref *)(ei + 1); | ||
| 1429 | } else { | ||
| 1430 | WARN_ON(key->type != BTRFS_EXTENT_ITEM_KEY); | ||
| 1431 | info = (struct btrfs_tree_block_info *)(ei + 1); | ||
| 1432 | *out_eiref = | ||
| 1433 | (struct btrfs_extent_inline_ref *)(info + 1); | ||
| 1434 | } | ||
| 1422 | } else { | 1435 | } else { |
| 1423 | *out_eiref = (struct btrfs_extent_inline_ref *)(ei + 1); | 1436 | *out_eiref = (struct btrfs_extent_inline_ref *)(ei + 1); |
| 1424 | } | 1437 | } |
| 1425 | *ptr = (unsigned long)*out_eiref; | 1438 | *ptr = (unsigned long)*out_eiref; |
| 1426 | if ((void *)*ptr >= (void *)ei + item_size) | 1439 | if ((unsigned long)(*ptr) >= (unsigned long)ei + item_size) |
| 1427 | return -ENOENT; | 1440 | return -ENOENT; |
| 1428 | } | 1441 | } |
| 1429 | 1442 | ||
| 1430 | end = (unsigned long)ei + item_size; | 1443 | end = (unsigned long)ei + item_size; |
| 1431 | *out_eiref = (struct btrfs_extent_inline_ref *)*ptr; | 1444 | *out_eiref = (struct btrfs_extent_inline_ref *)(*ptr); |
| 1432 | *out_type = btrfs_extent_inline_ref_type(eb, *out_eiref); | 1445 | *out_type = btrfs_extent_inline_ref_type(eb, *out_eiref); |
| 1433 | 1446 | ||
| 1434 | *ptr += btrfs_extent_inline_ref_size(*out_type); | 1447 | *ptr += btrfs_extent_inline_ref_size(*out_type); |
| @@ -1447,8 +1460,8 @@ static int __get_extent_inline_ref(unsigned long *ptr, struct extent_buffer *eb, | |||
| 1447 | * <0 on error. | 1460 | * <0 on error. |
| 1448 | */ | 1461 | */ |
| 1449 | int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, | 1462 | int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, |
| 1450 | struct btrfs_extent_item *ei, u32 item_size, | 1463 | struct btrfs_key *key, struct btrfs_extent_item *ei, |
| 1451 | u64 *out_root, u8 *out_level) | 1464 | u32 item_size, u64 *out_root, u8 *out_level) |
| 1452 | { | 1465 | { |
| 1453 | int ret; | 1466 | int ret; |
| 1454 | int type; | 1467 | int type; |
| @@ -1459,8 +1472,8 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb, | |||
| 1459 | return 1; | ||
