Skip to contentSkip to conversation

md: To more bugfixes for 2.6.25

PATCH New NeilBrown 1 participant 3 messages Mar 7, 2008 MD RAID

lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 md: To more bugfixes for 2.6.25

Two more little bug fixes for md in 2.6.25.

One fixes a formatting error in /proc/mdstat. Technically this is a user-interface change for an interface that has been around since 2.6.15. However the only program known to parse this file trips over the error. So I think it is safe to fix it.

The second fixes a small bug in a recent patch.

[PATCH 001 of 2] md: Fix formatting error in /proc/mdstat.
[PATCH 002 of 2] md: Reduce CPU wastage on idle md array with a write-intent bitmap. fix

author
#1 lore raw

PATCH 1/1 md: Fix formatting error in /proc/mdstat.

If an md array is "auto-read-only", then this appears in /proc/mdstat as

/dev/md0: active(auto-read-only)

whereas if it is truely readonly, it appears as

/dev/md0: active (read-only)

The difference being a space.

One program known to parse this file expects the space and gets badly confused. It will be fixed, but it would be best if what the kernel generates is more consistent too.

### Diffstat output

 ./drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
diff .prev/drivers/md/md.c ./drivers/md/md.c
@@ -5149,7 +5149,7 @@ static int md_seq_show(struct seq_file *
 			if (mddev->ro==1)
 				seq_printf(seq, " (read-only)");
 			if (mddev->ro==2)
-				seq_printf(seq, "(auto-read-only)");
+				seq_printf(seq, " (auto-read-only)");
 			seq_printf(seq, " %s", mddev->pers->name);
 		}
 
author
#2 lore raw

PATCH 1/1 md: Reduce CPU wastage on idle md array with a write-intent bitmap. fix

In reply to NeilBrown

Recent patch titled
Reduce CPU wastage on idle md array with a write-intent bitmap.

would sometimes leave the array with dirty bitmap bits that stay dirty. A subsequent write would sort things out so it isn't a big problem, but should be fixed nonetheless.

We need to make sure that when the bitmap becomes not "allclean", the daemon_sleep really does get set to a sensible value.

### Diffstat output

 ./drivers/md/bitmap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/bitmap.c +3 -1
diff .prev/drivers/md/bitmap.c ./drivers/md/bitmap.c
@@ -1045,7 +1045,8 @@ void bitmap_daemon_work(struct bitmap *b
 	if (bitmap == NULL)
 		return;
 	if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
-		return;
+		goto done;
+
 	bitmap->daemon_lastrun = jiffies;
 	if (bitmap->allclean) {
 		bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
@@ -1142,6 +1143,7 @@ void bitmap_daemon_work(struct bitmap *b
 		}
 	}
 
+ done:
 	if (bitmap->allclean == 0)
 		bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ;
 }