--- /usr/local/src/fr1-2.17/patches/linux-2.4.30.patch_3 2005-07-03 02:13:15.138238102 +0200 +++ /usr/local/src/fr1-2.17/patches/linux-2.4.30.patch_3_edited_2 2005-07-04 01:39:58.685997234 +0200 @@ -1,25 +1,27 @@ ---- linux-2.4.30/drivers/md/raid1.c.pre-fr1 Mon Apr 4 03:42:19 2005 -+++ linux-2.4.30/drivers/md/raid1.c Wed Apr 6 22:38:41 2005 -@@ -400,13 +465,65 @@ +--- linux-2.4/drivers/md/raid1.c.ORIG 2005-07-04 01:31:28.574219159 +0200 ++++ linux-2.4/drivers/md/raid1.c 2005-07-04 01:38:48.464417113 +0200 +@@ -400,13 +400,67 @@ static void inline sync_request_done (un static void raid1_end_bh_io (struct raid1_bh *r1_bh, int uptodate) { struct buffer_head *bh = r1_bh->master_bh; +#if defined(CONFIG_MD_FR1) || defined(CONFIG_MD_FR1_MODULE) + raid1_conf_t * conf = mddev_to_conf(r1_bh->mddev); - ++ + /* if nobody has done the final end_io yet, do it now */ + if (!test_and_set_bit(R1BH_AsyncPhase, &r1_bh->state)) { + + PRINTK(KERN_DEBUG "raid1: sync end i/o on sectors %lu-%lu\n", + bh->b_rsector, bh->b_rsector + (bh->b_size >> 9) - 1); - ++ + io_request_done(bh->b_rsector, conf, + test_bit(R1BH_SyncPhase, &r1_bh->state)); + bh->b_end_io(bh, uptodate); + } +#else + io_request_done(bh->b_rsector, mddev_to_conf(r1_bh->mddev), - test_bit(R1BH_SyncPhase, &r1_bh->state)); + test_bit(R1BH_SyncPhase, &r1_bh->state)); + bh->b_end_io(bh, uptodate); +#endif /* CONFIG_MD_FR1 */ + @@ -60,7 +62,7 @@ + } + } +#endif /* CONFIG_MD_FR1 */ - raid1_free_r1bh(r1_bh); + raid1_free_r1bh(r1_bh); } + void raid1_end_request (struct buffer_head *bh, int uptodate)