Merge branch 'for-4.13-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba: "Fixes addressing problems reported by users, and there's one more regression fix" * 'for-4.13-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: round down size diff when shrinking/growing device Btrfs: fix early ENOSPC due to delalloc btrfs: fix lockup in find_free_extent with read-only block groups Btrfs: fix dir item validation when replaying xattr deletes
This commit is contained in:
commit
0a2a1330d2
@ -4825,10 +4825,6 @@ skip_async:
|
|||||||
else
|
else
|
||||||
flush = BTRFS_RESERVE_NO_FLUSH;
|
flush = BTRFS_RESERVE_NO_FLUSH;
|
||||||
spin_lock(&space_info->lock);
|
spin_lock(&space_info->lock);
|
||||||
if (can_overcommit(fs_info, space_info, orig, flush, false)) {
|
|
||||||
spin_unlock(&space_info->lock);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (list_empty(&space_info->tickets) &&
|
if (list_empty(&space_info->tickets) &&
|
||||||
list_empty(&space_info->priority_tickets)) {
|
list_empty(&space_info->priority_tickets)) {
|
||||||
spin_unlock(&space_info->lock);
|
spin_unlock(&space_info->lock);
|
||||||
@ -7589,6 +7585,10 @@ search:
|
|||||||
u64 offset;
|
u64 offset;
|
||||||
int cached;
|
int cached;
|
||||||
|
|
||||||
|
/* If the block group is read-only, we can skip it entirely. */
|
||||||
|
if (unlikely(block_group->ro))
|
||||||
|
continue;
|
||||||
|
|
||||||
btrfs_grab_block_group(block_group, delalloc);
|
btrfs_grab_block_group(block_group, delalloc);
|
||||||
search_start = block_group->key.objectid;
|
search_start = block_group->key.objectid;
|
||||||
|
|
||||||
@ -7624,8 +7624,6 @@ have_block_group:
|
|||||||
|
|
||||||
if (unlikely(block_group->cached == BTRFS_CACHE_ERROR))
|
if (unlikely(block_group->cached == BTRFS_CACHE_ERROR))
|
||||||
goto loop;
|
goto loop;
|
||||||
if (unlikely(block_group->ro))
|
|
||||||
goto loop;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ok we want to try and use the cluster allocator, so
|
* Ok we want to try and use the cluster allocator, so
|
||||||
@ -7839,6 +7837,7 @@ loop:
|
|||||||
failed_alloc = false;
|
failed_alloc = false;
|
||||||
BUG_ON(index != get_block_group_index(block_group));
|
BUG_ON(index != get_block_group_index(block_group));
|
||||||
btrfs_release_block_group(block_group, delalloc);
|
btrfs_release_block_group(block_group, delalloc);
|
||||||
|
cond_resched();
|
||||||
}
|
}
|
||||||
up_read(&space_info->groups_sem);
|
up_read(&space_info->groups_sem);
|
||||||
|
|
||||||
|
@ -2153,8 +2153,7 @@ process_leaf:
|
|||||||
u32 this_len = sizeof(*di) + name_len + data_len;
|
u32 this_len = sizeof(*di) + name_len + data_len;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
ret = verify_dir_item(fs_info, path->nodes[0],
|
ret = verify_dir_item(fs_info, path->nodes[0], i, di);
|
||||||
path->slots[0], di);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -2702,7 +2702,7 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans,
|
|||||||
|
|
||||||
mutex_lock(&fs_info->chunk_mutex);
|
mutex_lock(&fs_info->chunk_mutex);
|
||||||
old_total = btrfs_super_total_bytes(super_copy);
|
old_total = btrfs_super_total_bytes(super_copy);
|
||||||
diff = new_size - device->total_bytes;
|
diff = round_down(new_size - device->total_bytes, fs_info->sectorsize);
|
||||||
|
|
||||||
if (new_size <= device->total_bytes ||
|
if (new_size <= device->total_bytes ||
|
||||||
device->is_tgtdev_for_dev_replace) {
|
device->is_tgtdev_for_dev_replace) {
|
||||||
@ -4406,7 +4406,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
|
|||||||
u64 diff;
|
u64 diff;
|
||||||
|
|
||||||
new_size = round_down(new_size, fs_info->sectorsize);
|
new_size = round_down(new_size, fs_info->sectorsize);
|
||||||
diff = old_size - new_size;
|
diff = round_down(old_size - new_size, fs_info->sectorsize);
|
||||||
|
|
||||||
if (device->is_tgtdev_for_dev_replace)
|
if (device->is_tgtdev_for_dev_replace)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user