From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:39293 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004AbbBTOf2 (ORCPT ); Fri, 20 Feb 2015 09:35:28 -0500 Date: Fri, 20 Feb 2015 15:35:26 +0100 From: David Sterba To: Chris Mason , linux-btrfs , Zhao Lei Subject: Re: [PATCH] Btrfs: fix allocation size calculations in alloc_btrfs_bio Message-ID: <20150220143526.GS8720@suse.cz> Reply-To: dsterba@suse.cz References: <20150220015930.GA28726@ret.masoncoding.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20150220015930.GA28726@ret.masoncoding.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Thu, Feb 19, 2015 at 08:59:30PM -0500, Chris Mason wrote: > Since commit 8e5cfb55d3f (Btrfs: Make raid_map array be inlined in > btrfs_bio structure), the raid map array is allocated along with the > btrfs bio in alloc_btrfs_bio. The calculation used to decide how much > we need to allocate was using the wrong parameter passed into the > allocation function. > > The passed in real_stripes will be zero if a target replace operation > is not currently running. We want to use total_stripes instead. > > Signed-off-by: Chris Mason > Reported-by: Dave Sterba Tested-by: David Sterba Current master + this patch with full slub_debug is now ok with btrfs/023.