From patchwork Tue Apr 12 10:42:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Jansen X-Patchwork-Id: 699631 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 p3CAgdxv002596 for ; Tue, 12 Apr 2011 10:42:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757032Ab1DLKmh (ORCPT ); Tue, 12 Apr 2011 06:42:37 -0400 Received: from ysabell.rzone.de ([81.169.144.237]:18888 "EHLO ysabell.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756934Ab1DLKmf (ORCPT ); Tue, 12 Apr 2011 06:42:35 -0400 Received: from gargravarr.store (gargravarr.store [192.168.42.236]) by ysabell.rzone.de (Postfix) with ESMTP id 0EB06215; Tue, 12 Apr 2011 12:42:32 +0200 (MEST) Received: by gargravarr.store (Postfix, from userid 32466) id C496744DC9; Tue, 12 Apr 2011 12:42:31 +0200 (CEST) From: Arne Jansen To: chris.mason@oracle.com, linux-btrfs@vger.kernel.org Subject: [PATCH v2 2/3] btrfs: heed alloc_start Date: Tue, 12 Apr 2011 12:42:30 +0200 Message-Id: <7a53b9516d986fa7409bf242d1f31f65390e2dad.1302604903.git.sensille@gmx.net> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: 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]); Tue, 12 Apr 2011 10:42:40 +0000 (UTC) currently alloc_start is disregarded if the requested chunk size is bigger than (device size - alloc_start), but smaller than the device size. The only situation where I see this could have made sense was when a chunk equal the size of the device has been requested. This was possible as the allocator failed to take alloc_start into account when calculating the request chunk size. As this gets fixed by this patch, the workaround is not necessary anymore. Signed-off-by: Arne Jansen --- fs/btrfs/volumes.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a9f1fc2..45c592a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -849,10 +849,7 @@ int find_free_dev_extent(struct btrfs_trans_handle *trans, /* we don't want to overwrite the superblock on the drive, * so we make sure to start at an offset of at least 1MB */ - search_start = 1024 * 1024; - - if (root->fs_info->alloc_start + num_bytes <= search_end) - search_start = max(root->fs_info->alloc_start, search_start); + search_start = max(root->fs_info->alloc_start, 1024ull * 1024); max_hole_start = search_start; max_hole_size = 0;