From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757474AbYHASWi (ORCPT ); Fri, 1 Aug 2008 14:22:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752296AbYHASW1 (ORCPT ); Fri, 1 Aug 2008 14:22:27 -0400 Received: from mga14.intel.com ([143.182.124.37]:51108 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727AbYHASW0 (ORCPT ); Fri, 1 Aug 2008 14:22:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.31,294,1215414000"; d="scan'208";a="28609317" Subject: Re: [PULL REQUEST] md bug fixes and minor improvements From: Dan Williams To: Jens Axboe Cc: Linus Torvalds , Neil Brown , Arthur Jones , Linux Kernel Mailing List , linux-raid@vger.kernel.org, "Rafael J. Wysocki" In-Reply-To: <20080801174024.GH20055@kernel.dk> References: <18578.31924.259887.735206@notabene.brown> <20080801172231.GF20055@kernel.dk> <1217612088.24551.5.camel@dwillia2-linux.ch.intel.com> <20080801174024.GH20055@kernel.dk> Content-Type: text/plain Date: Fri, 01 Aug 2008 11:22:25 -0700 Message-Id: <1217614945.24551.16.camel@dwillia2-linux.ch.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-5.fc8) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2008-08-01 at 10:40 -0700, Jens Axboe wrote: > On Fri, Aug 01 2008, Dan Williams wrote: > > > > On Fri, 2008-08-01 at 19:22 +0200, Jens Axboe wrote: > > > It is a bit asymmetrical, largely due to the fact that the ->unplug_fn() > > > itself grabs the lock. The below patch should fix it, since Neil has > > > added a proper queue lock to the md queues. If someone can confirm that > > > this fixes it, I'll queue up a patch with proper descriptions. > > > > > > > I guess Jens is gone too.. > > > > > > I'm back, just been busy this week :-) > > > > > > diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c > > > index 621a272..f19b52f 100644 > > > --- a/drivers/md/bitmap.c > > > +++ b/drivers/md/bitmap.c > > > @@ -1234,7 +1234,9 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect > > > case 0: > > > bitmap_file_set_bit(bitmap, offset); > > > bitmap_count_page(bitmap,offset, 1); > > > + spin_lock_irq(&bitmap->mddev->queue->queue_lock); > > > blk_plug_device(bitmap->mddev->queue); > > > + spin_unlock_irq(&bitmap->mddev->queue->queue_lock); > > > /* fall through */ > > > case 1: > > > *bmc = 2; > > > > > > > We also need to protect the blk_plug_device call a few lines down (and > > an obvious compile fix). > > Old source I guess, just one blk_plug_device() in the copy I have here. > Just checked latest git, still just one blk_plug_device(), are you > diffing against -mm or something like that? Or linux-next? No, my mistake... I crossed my eyes and misread your patch as protecting blk_unplug() a few lines up, sorry. > > And queue_lock is of course a pointer, I didn't even compile the > thing... Thanks for the updated variant! I have verified that: mdadm --create /dev/md0 /dev/sd[bc] -n 2 -l 1 --bitmap=internal dd if=/dev/zero of=/dev/md0 bs=1024k count=1 ...no longer triggers the warning with your fix. Regards, Dan