Browse Source

Btrfs: properly update space information after shrinking device.

Change 'goto done' to 'break' for the case of all device extents have
been freed, so that the code updates space information will be execute.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Yan Zheng 16 years ago
parent
commit
bf1fb512a5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      fs/btrfs/volumes.c

+ 2 - 2
fs/btrfs/volumes.c

@@ -2007,7 +2007,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
 			goto done;
 			goto done;
 		if (ret) {
 		if (ret) {
 			ret = 0;
 			ret = 0;
-			goto done;
+			break;
 		}
 		}
 
 
 		l = path->nodes[0];
 		l = path->nodes[0];
@@ -2015,7 +2015,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
 		btrfs_item_key_to_cpu(l, &key, path->slots[0]);
 		btrfs_item_key_to_cpu(l, &key, path->slots[0]);
 
 
 		if (key.objectid != device->devid)
 		if (key.objectid != device->devid)
-			goto done;
+			break;
 
 
 		dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
 		dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
 		length = btrfs_dev_extent_length(l, dev_extent);
 		length = btrfs_dev_extent_length(l, dev_extent);