[dm-devel] patch for log_enqueue in multipath-tools-0.4.4-pre11
Benjamin Marzinski
bmarzins at redhat.com
Mon Apr 11 20:59:50 UTC 2005
It looks to me like log_enqueue can accidentally mess up its la->tail ptr,
if it runs out of space for the new message.
If the la->head is just past la->start, and la->tail is just before la->end,
la->tail will get updated to be la->start, because there is no room at the
end of the buffer for the message. Then when it realizes that there is no
room at the start of the buffer, la->tail will be updated to la->start - fwd
And the next message will be written before the buffer.
This patch fixes that.
-Ben
Ben Marzinski
bmarzins at redhat.com
(612) 638-0517
-------------- next part --------------
diff -urN multipath-tools-0.4.4-pre11/multipathd/log.c multipath-tools-0.4.4-log-fixed/multipathd/log.c
--- multipath-tools-0.4.4-pre11/multipathd/log.c 2005-03-31 03:25:06.000000000 -0600
+++ multipath-tools-0.4.4-log-fixed/multipathd/log.c 2005-04-11 14:27:41.000000000 -0500
@@ -119,7 +119,7 @@
logdbg(stderr, "enqueue: log area overrun, drop msg\n");
if (!la->empty)
- la->tail -= fwd;
+ la->tail = lastmsg;
return 1;
}
More information about the dm-devel
mailing list