Re: [BUG 2.6.32] md/raid1: barrier disabling does not work correctly in all cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK, so I finally got back to this. Just FYI, a slight adjustment to
the patch was needed (bitmap_info now has the max_write_behind field).
It's attached. You need both the barrier-retry-fix-2 patch that I
posted a while back and this one.

Thanks,
Paul



On Tue, Feb 1, 2011 at 8:04 PM, Paul Clements <paul.clements@xxxxxxxxxxx> wrote:
> On Tue, Feb 1, 2011 at 7:32 PM, NeilBrown <neilb@xxxxxxx> wrote:
>> On Tue, 1 Feb 2011 15:45:16 -0500 Paul Clements <paul.clements@xxxxxxxxxxx>
>> wrote:
>> Disabling behind-writes for all barrier requests would be quite easy, but it
>> might negate a lot of the value of behind writes
>
> Agreed...
>
>> I think the best option is to reject barrier writes if there are any
>> behind-write devices.  That would be reasonably safe and reasonably
>> consistent.
>
> Yeah, I was leaning toward this.
>
>> So maybe something like this??
>
> Yes, I think that would work.
>
> Thanks,
> Paul
>
--- ./drivers/md/bitmap.c.PRISTINE	2011-02-23 17:40:26.633270814 -0500
+++ ./drivers/md/bitmap.c	2011-02-23 14:47:38.652434745 -0500
@@ -1298,8 +1298,7 @@ int bitmap_startwrite(struct bitmap *bit
 		if (bw > bitmap->behind_writes_used)
 			bitmap->behind_writes_used = bw;
 
-		PRINTK(KERN_DEBUG "inc write-behind count %d/%d\n",
-		       bw, bitmap->max_write_behind);
+		PRINTK(KERN_DEBUG "inc write-behind count %d\n", bw);
 	}
 
 	while (sectors) {
@@ -1357,8 +1356,8 @@ void bitmap_endwrite(struct bitmap *bitm
 	if (!bitmap) return;
 	if (behind) {
 		atomic_dec(&bitmap->behind_writes);
-		PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n",
-		  atomic_read(&bitmap->behind_writes), bitmap->max_write_behind);
+		PRINTK(KERN_DEBUG "dec write-behind count %d\n",
+		  atomic_read(&bitmap->behind_writes));
 	}
 	if (bitmap->mddev->degraded)
 		/* Never clear bits or update events_cleared when degraded */
@@ -1713,6 +1712,10 @@ int bitmap_create(mddev_t *mddev)
 	if (err)
 		goto error;
 
+	/* write behind and barrier write retries are not compatible */
+	if (mddev->bitmap_info.max_write_behind)
+		mddev->barriers_work = 0;
+
 	bitmap->daemon_lastrun = jiffies;
 	bitmap->chunkshift = ffz(~mddev->bitmap_info.chunksize);
 

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux