]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] (workaround): avoid raid1 crash during resync with qlogic controllers
authorAndrew Morton <akpm@osdl.org>
Tue, 30 Dec 2003 07:48:19 +0000 (23:48 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 30 Dec 2003 07:48:19 +0000 (23:48 -0800)
qlogic's 16k maximum I/O size bites again.  Neil says:

 The problems we fixed were all to do with normal IO.  This one is resync
 IO.

 The problem here is that raid1 always does resync in RESYNC_BLOCK_SIZE
 (=64k) IOs and if the device doesn't cope - tough.

 The simple fix is to #define RESYNC_BLOCK_SIZE to PAGE_SIZE in md/raid1.c

 The better fix is to rewrite the raid1 resync code to use bio_add_page.

 This means we have to build the read request and the write requests at the
 same time, and then when a bio_add_page fails, we back-out the last page
 from the bios that have one too many, and then do the read followed by the
 writes.

 I have some code the nearly does this, but I haven't got it actually
 working yet and I am on leave until mid January.

 I would recommend doing

 fs/drivers/md/raid1.c:
 -#define RESYNC_BLOCK_SIZE (64*1024)
 +#define RESYNC_BLOCK_SIZE PAGE_SIZE

 for now.

drivers/md/raid1.c

index 54144f2a2f3ce8ac5fe7b4cbdcba3c27a9a46330..280a0ef77669461cb9a32daa660f1fce230b450e 100644 (file)
@@ -56,7 +56,8 @@ static void r1bio_pool_free(void *r1_bio, void *data)
        kfree(r1_bio);
 }
 
-#define RESYNC_BLOCK_SIZE (64*1024)
+//#define RESYNC_BLOCK_SIZE (64*1024)
+#define RESYNC_BLOCK_SIZE PAGE_SIZE
 #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
 #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
 #define RESYNC_WINDOW (2048*1024)