diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-19 17:36:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-19 17:36:00 -0500 |
commit | 2b9fb532d4168e8974fe49709e2c4c8d5352a64c (patch) | |
tree | 610cbe2d1bb32e28db135a767f158ade31452e2e /fs/btrfs/backref.c | |
parent | 4533f6e27a366ecc3da4876074ebfe0cc0ea4f0f (diff) | |
parent | a742994aa2e271eb8cd8e043d276515ec858ed73 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
Pull btrfs updates from Chris Mason:
"This pull is mostly cleanups and fixes:
- The raid5/6 cleanups from Zhao Lei fixup some long standing warts
in the code and add improvements on top of the scrubbing support
from 3.19.
- Josef has round one of our ENOSPC fixes coming from large btrfs
clusters here at FB.
- Dave Sterba continues a long series of cleanups (thanks Dave), and
Filipe continues hammering on corner cases in fsync and others
This all was held up a little trying to track down a use-after-free in
btrfs raid5/6. It's not clear yet if this is just made easier to
trigger with this pull or if its a new bug from the raid5/6 cleanups.
Dave Sterba is the only one to trigger it so far, but he has a
consistent way to reproduce, so we'll get it nailed shortly"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (68 commits)
Btrfs: don't remove extents and xattrs when logging new names
Btrfs: fix fsync data loss after adding hard link to inode
Btrfs: fix BUG_ON in btrfs_orphan_add() when delete unused block group
Btrfs: account for large extents with enospc
Btrfs: don't set and clear delalloc for O_DIRECT writes
Btrfs: only adjust outstanding_extents when we do a short write
btrfs: Fix out-of-space bug
Btrfs: scrub, fix sleep in atomic context
Btrfs: fix scheduler warning when syncing log
Btrfs: Remove unnecessary placeholder in btrfs_err_code
btrfs: cleanup init for list in free-space-cache
btrfs: delete chunk allocation attemp when setting block group ro
btrfs: clear bio reference after submit_one_bio()
Btrfs: fix scrub race leading to use-after-free
Btrfs: add missing cleanup on sysfs init failure
Btrfs: fix race between transaction commit and empty block group removal
btrfs: add more checks to btrfs_read_sys_array
btrfs: cleanup, rename a few variables in btrfs_read_sys_array
btrfs: add checks for sys_chunk_array sizes
btrfs: more superblock checks, lower bounds on devices and sectorsize/nodesize
...
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 8729cf68d2fe..f55721ff9385 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -1246,25 +1246,6 @@ int btrfs_check_shared(struct btrfs_trans_handle *trans, | |||
1246 | return ret; | 1246 | return ret; |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | /* | ||
1250 | * this makes the path point to (inum INODE_ITEM ioff) | ||
1251 | */ | ||
1252 | int inode_item_info(u64 inum, u64 ioff, struct btrfs_root *fs_root, | ||
1253 | struct btrfs_path *path) | ||
1254 | { | ||
1255 | struct btrfs_key key; | ||
1256 | return btrfs_find_item(fs_root, path, inum, ioff, | ||
1257 | BTRFS_INODE_ITEM_KEY, &key); | ||
1258 | } | ||
1259 | |||
1260 | static int inode_ref_info(u64 inum, u64 ioff, struct btrfs_root *fs_root, | ||
1261 | struct btrfs_path *path, | ||
1262 | struct btrfs_key *found_key) | ||
1263 | { | ||
1264 | return btrfs_find_item(fs_root, path, inum, ioff, | ||
1265 | BTRFS_INODE_REF_KEY, found_key); | ||
1266 | } | ||
1267 | |||
1268 | int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, | 1249 | int btrfs_find_one_extref(struct btrfs_root *root, u64 inode_objectid, |
1269 | u64 start_off, struct btrfs_path *path, | 1250 | u64 start_off, struct btrfs_path *path, |
1270 | struct btrfs_inode_extref **ret_extref, | 1251 | struct btrfs_inode_extref **ret_extref, |
@@ -1374,7 +1355,8 @@ char *btrfs_ref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, | |||
1374 | btrfs_tree_read_unlock_blocking(eb); | 1355 | btrfs_tree_read_unlock_blocking(eb); |
1375 | free_extent_buffer(eb); | 1356 | free_extent_buffer(eb); |
1376 | } | 1357 | } |
1377 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); | 1358 | ret = btrfs_find_item(fs_root, path, parent, 0, |
1359 | BTRFS_INODE_REF_KEY, &found_key); | ||
1378 | if (ret > 0) | 1360 | if (ret > 0) |
1379 | ret = -ENOENT; | 1361 | ret = -ENOENT; |
1380 | if (ret) | 1362 | if (ret) |
@@ -1727,8 +1709,10 @@ static int iterate_inode_refs(u64 inum, struct btrfs_root *fs_root, | |||
1727 | struct btrfs_key found_key; | 1709 | struct btrfs_key found_key; |
1728 | 1710 | ||
1729 | while (!ret) { | 1711 | while (!ret) { |
1730 | ret = inode_ref_info(inum, parent ? parent+1 : 0, fs_root, path, | 1712 | ret = btrfs_find_item(fs_root, path, inum, |
1731 | &found_key); | 1713 | parent ? parent + 1 : 0, BTRFS_INODE_REF_KEY, |
1714 | &found_key); | ||
1715 | |||
1732 | if (ret < 0) | 1716 | if (ret < 0) |
1733 | break; | 1717 | break; |
1734 | if (ret) { | 1718 | if (ret) { |