From patchwork Tue Nov 30 00:07:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 365642 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAU0A686024007 for ; Tue, 30 Nov 2010 00:10:32 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAU07tJj010052; Mon, 29 Nov 2010 19:07:56 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oAU07r2r011657 for ; Mon, 29 Nov 2010 19:07:53 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.12]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAU07mdN028670 for ; Mon, 29 Nov 2010 19:07:48 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAU07cnM026651 for ; Mon, 29 Nov 2010 19:07:39 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 3D30D86A2E; Tue, 30 Nov 2010 01:07:37 +0100 (CET) Date: Tue, 30 Nov 2010 11:07:25 +1100 From: Neil Brown To: device-mapper development Message-ID: <20101130110725.5f2d2407@notabene.brown> In-Reply-To: <4CC03D24020000A100010898@gwsmtp1.uni-regensburg.de> References: <4CC03D24020000A100010898@gwsmtp1.uni-regensburg.de> Mime-Version: 1.0 X-RedHat-Spam-Score: -2.31 (RCVD_IN_DNSWL_MED,T_RP_MATCHES_RCVD) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.12 X-loop: dm-devel@redhat.com Cc: Ulrich.Windl@rz.uni-regensburg.de, open-iscsi Subject: Re: [dm-devel] Q: md-RAID1 creation with I/O error (attempt to access beyond end of device) X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Nov 2010 00:10:32 +0000 (UTC) --- mdadm-2.6.orig/super0.c +++ mdadm-2.6/super0.c @@ -833,7 +833,7 @@ static int add_internal_bitmap0(struct s * size is in sectors, chunk is in bytes !!! */ unsigned long long bits; - unsigned long long max_bits = 60*1024*8; + unsigned long long max_bits = (60*1024 - sizeof(bitmap_super_t))*8; unsigned long long min_chunk; int chunk = *chunkp; mdp_super_t *sb = sbv; --- mdadm-2.6.orig/super0.c +++ mdadm-2.6/super0.c @@ -833,7 +833,7 @@ static int add_internal_bitmap0(struct s * size is in sectors, chunk is in bytes !!! */ unsigned long long bits; - unsigned long long max_bits = 60*1024*8; + unsigned long long max_bits = (60*1024 - sizeof(bitmap_super_t))*8; unsigned long long min_chunk; int chunk = *chunkp; mdp_super_t *sb = sbv;