From patchwork Fri Feb 25 23:43:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 591681 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1PNhIsX001456 for ; Fri, 25 Feb 2011 23:43:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932869Ab1BYXnQ (ORCPT ); Fri, 25 Feb 2011 18:43:16 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:51701 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754778Ab1BYXnP (ORCPT ); Fri, 25 Feb 2011 18:43:15 -0500 Received: by fxm17 with SMTP id 17so2227589fxm.19 for ; Fri, 25 Feb 2011 15:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=jxsl1zEi5QgLMQZF0IJ9O7C7Pa/h4xBlgsrd38kMjZ8=; b=HhM1mPDBsP6OB8XEJkEo4ymdb1jZ8uD/ar557Ob22uXObFhcbnzkQoBxLN0YiiG3T8 /lDejjwzrfljpnrNt0b/tMHyO9PJOamax+TlpkJ+wG+N4dL2aCq8Hcw8jIboBNFHpxR5 2T0WmaqGqn2gKajbNuqD4wZLOPY9So53nCjHw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=kRX5/AV28tbGc3GR5y6Vy2EAxBDrn5wBrV9cfPFgrAHgSpRSGVNFPM0k5PgZTog07X BgptBL1dTyXyyE9XJb6DBU1yASyDhY1PkeOPvU5irsf5y77W2GHxRAEHY6Hze97rBx/3 q/CB8Ew1kyv6k5PlJ2yxdPCFW3dWY+ADvpuRs= Received: by 10.223.70.141 with SMTP id d13mr3389299faj.111.1298677394195; Fri, 25 Feb 2011 15:43:14 -0800 (PST) Received: from localhost ([109.110.86.6]) by mx.google.com with ESMTPS id 17sm575905far.43.2011.02.25.15.43.12 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Feb 2011 15:43:12 -0800 (PST) Date: Sat, 26 Feb 2011 01:43:10 +0200 From: Ilya Dryomov To: linux-btrfs@vger.kernel.org Cc: Chris Mason Subject: [PATCH] Btrfs: fix infinite loop in btrfs_shrink_device() Message-ID: <20110225234310.GA2567@kwango.lan.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Feb 2011 23:43:18 +0000 (UTC) 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) {