mirror of
https://github.com/schoebel/mars
synced 2025-02-18 13:06:58 +00:00
logger: avoid potential races between IO and symlink updates
This commit is contained in:
parent
39ed143e27
commit
5b523f16f7
@ -2908,6 +2908,9 @@ void trans_logger_replay(struct trans_logger_brick *brick)
|
|||||||
if ((atomic_read(&brick->replay_count) <= 0 ||
|
if ((atomic_read(&brick->replay_count) <= 0 ||
|
||||||
((long long)jiffies) - old_jiffies >= HZ * 3) &&
|
((long long)jiffies) - old_jiffies >= HZ * 3) &&
|
||||||
finished_pos >= 0) {
|
finished_pos >= 0) {
|
||||||
|
// for safety, wait until the IO queue has drained.
|
||||||
|
wait_event_interruptible_timeout(brick->worker_event, atomic_read(&brick->replay_count) <= 0, 1 * HZ);
|
||||||
|
|
||||||
down(&input->inf_mutex);
|
down(&input->inf_mutex);
|
||||||
input->inf.inf_min_pos = finished_pos;
|
input->inf.inf_min_pos = finished_pos;
|
||||||
get_lamport(&input->inf.inf_min_pos_stamp);
|
get_lamport(&input->inf.inf_min_pos_stamp);
|
||||||
|
Loading…
Reference in New Issue
Block a user