From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 001 of 3] md: Don't clear bits in bitmap when writing to one device fails during recovery. Date: Wed, 29 Mar 2006 22:12:09 -0800 Message-ID: <20060329221209.20e7fd00.akpm@osdl.org> References: <20060330164933.25210.patches@notabene> <1060330055237.25270@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1060330055237.25270@suse.de> Sender: linux-kernel-owner@vger.kernel.org To: NeilBrown Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-raid.ids NeilBrown wrote: > > + if (!uptodate) { > + int sync_blocks = 0; > + sector_t s = r1_bio->sector; > + long sectors_to_go = r1_bio->sectors; > + /* make sure these bits doesn't get cleared. */ > + do { > + bitmap_end_sync(mddev->bitmap, r1_bio->sector, > + &sync_blocks, 1); > + s += sync_blocks; > + sectors_to_go -= sync_blocks; > + } while (sectors_to_go > 0); > md_error(mddev, conf->mirrors[mirror].rdev); > + } Can mddev->bitmap be NULL? If so, will the above loop do the right thing when this: void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted) { bitmap_counter_t *bmc; unsigned long flags; /* if (offset == 0) printk("bitmap_end_sync 0 (%d)\n", aborted); */ if (bitmap == NULL) { *blocks = 1024; return; } triggers?