diff mbox

Btrfs: fix infinite loop in btrfs_shrink_device()

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

Commit Message

Ilya Dryomov Feb. 25, 2011, 11:43 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index dd13eb8..0cb94ce 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 == -1)
+			break;
 	}
 
 	if (failed && !retried) {