From patchwork Sat Feb 26 14:15:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 592471 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 p1QEFxB6026019 for ; Sat, 26 Feb 2011 14:15:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751083Ab1BZOP4 (ORCPT ); Sat, 26 Feb 2011 09:15:56 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:36120 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995Ab1BZOPz (ORCPT ); Sat, 26 Feb 2011 09:15:55 -0500 Received: by fxm17 with SMTP id 17so2568727fxm.19 for ; Sat, 26 Feb 2011 06:15:54 -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:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=yc71sEDHQMWd+9JOExc6RIIHNA5j/b5cQV5teR+8C44=; b=hHGDXogFl2qdDHdIdc6TFnU3tao+wII6vwiJ0Y+qGxqlnjxcnOoKD/+ObokXM/ydF3 PnB1oFW4MHuigLDaqw9xeUc/9iB0g7hnvLSeUO8r2OCLKF/20srBKbgnUJ268EgTpbdS nG4yuvex9AzZ0BgJZVb8QKY6X0PhJ4KtvG/zA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=TSqlg7vW6X3R1YEK8bYpTw7ZY4Zj0v5rV9l1RTFv3IoAuYcGTohK0xyMvhJdgdMa3T BzLqGBYdf0HQGBPBnEHCgoLJYa2Zbc6GxOtSLtZouAZDXEPLCxvpdSxxQv5N+dRMfF5U pZU5aHrjBMrKg7hKj6XB1O9KzSOqM8p88UMow= Received: by 10.223.78.138 with SMTP id l10mr4079814fak.17.1298729754549; Sat, 26 Feb 2011 06:15:54 -0800 (PST) Received: from localhost ([109.110.86.6]) by mx.google.com with ESMTPS id b7sm765307faa.42.2011.02.26.06.15.52 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Feb 2011 06:15:53 -0800 (PST) Date: Sat, 26 Feb 2011 16:15:49 +0200 From: Ilya Dryomov To: "Yan, Zheng " Cc: linux-btrfs@vger.kernel.org, Chris Mason Subject: Re: [PATCH] Btrfs: fix infinite loop in btrfs_shrink_device() Message-ID: <20110226141549.GA2550@kwango.lan.net> References: <20110225234310.GA2567@kwango.lan.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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]); Sat, 26 Feb 2011 14:15:59 +0000 (UTC) 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) {