diff mbox

Btrfs: fix infinite loop in btrfs_shrink_device()

Message ID 20110226141549.GA2550@kwango.lan.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ilya Dryomov Feb. 26, 2011, 2:15 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index dd13eb8..cd334ae 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2212,7 +2212,8 @@  again:
 			goto done;
 		if (ret == -ENOSPC)
 			failed++;
-		key.offset -= 1;
+		if (--key.offset == (u64)-1)
+			break;
 	}
 
 	if (failed && !retried) {