From: Nikitas Angelinas Date: Sat, 8 Oct 2011 21:24:00 +0000 (-0400) Subject: ext4: MMP: fix error message rate-limiting logic in kmmpd X-Git-Tag: next-20111011~83^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=837f067d0b5d6e21c1ce2ab6a1236e21a487a29c;p=karo-tx-linux.git ext4: MMP: fix error message rate-limiting logic in kmmpd Current logic would print an error message only once, and then 'failed_writes' would stay at 1. Rework the loop to increment 'failed_writes' and print the error message every s_mmp_update_interval * 60 seconds, as intended according to the comment. Signed-off-by: Nikitas Angelinas Signed-off-by: Andrew Perepechko Signed-off-by: "Theodore Ts'o" Acked-by: Andreas Dilger --- diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index 2fca64efd6db..6b327423e622 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -125,8 +125,9 @@ static int kmmpd(void *data) * Don't spew too many error messages. Print one every * (s_mmp_update_interval * 60) seconds. */ - if (retval && (failed_writes % 60) == 0) { - ext4_error(sb, "Error writing to MMP block"); + if (retval) { + if ((failed_writes % 60) == 0) + ext4_error(sb, "Error writing to MMP block"); failed_writes++; }