Skip to contentSkip to conversation

properly update space information after shrinking device.

PATCH New Yan Zheng 1 participant 1 message Jul 15, 2009 Btrfs file system

lore
Share & tools
lore

Yan Zheng

author
#0 lore raw

PATCH 1/1 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.

---

fs/btrfs/volumes.c +2 -2
diff -urp 1/fs/btrfs/volumes.c 2/fs/btrfs/volumes.c
@@ -2007,7 +2007,7 @@ int btrfs_shrink_device(struct btrfs_dev
 			goto done;
 		if (ret) {
 			ret = 0;
-			goto done;
+			break;
 		}
 
 		l = path->nodes[0];
@@ -2015,7 +2015,7 @@ int btrfs_shrink_device(struct btrfs_dev
 		btrfs_item_key_to_cpu(l, &key, path->slots[0]);
 
 		if (key.objectid != device->devid)
-			goto done;
+			break;
 
 		dev_extent = btrfs_item_ptr(l, slot, struct btrfs_dev_extent);
 		length = btrfs_dev_extent_length(l, dev_extent);