diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8be7d7a759ce..a0faf7d7f0e0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3172,6 +3172,11 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, | |||
3172 | 3172 | ||
3173 | BUG_ON(new_size > 0 && min_type != BTRFS_EXTENT_DATA_KEY); | 3173 | BUG_ON(new_size > 0 && min_type != BTRFS_EXTENT_DATA_KEY); |
3174 | 3174 | ||
3175 | path = btrfs_alloc_path(); | ||
3176 | if (!path) | ||
3177 | return -ENOMEM; | ||
3178 | path->reada = -1; | ||
3179 | |||
3175 | if (root->ref_cows || root == root->fs_info->tree_root) | 3180 | if (root->ref_cows || root == root->fs_info->tree_root) |
3176 | btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0); | 3181 | btrfs_drop_extent_cache(inode, new_size & (~mask), (u64)-1, 0); |
3177 | 3182 | ||
@@ -3184,10 +3189,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, | |||
3184 | if (min_type == 0 && root == BTRFS_I(inode)->root) | 3189 | if (min_type == 0 && root == BTRFS_I(inode)->root) |
3185 | btrfs_kill_delayed_inode_items(inode); | 3190 | btrfs_kill_delayed_inode_items(inode); |
3186 | 3191 | ||
3187 | path = btrfs_alloc_path(); | ||
3188 | BUG_ON(!path); | ||
3189 | path->reada = -1; | ||
3190 | |||
3191 | key.objectid = ino; | 3192 | key.objectid = ino; |
3192 | key.offset = (u64)-1; | 3193 | key.offset = (u64)-1; |
3193 | key.type = (u8)-1; | 3194 | key.type = (u8)-1; |