Skip to content

Commit

Permalink
mxraid: Add deadlock workaround to mdcheck.safe
Browse files Browse the repository at this point in the history
Sometimes, when the check is paused by setting sync_action to "idle",
the array deadlocks. It can be continued by setting array_state to
active.

If it takes more 10 seconds to set the sync_action to idle and the array
state is write-pending, then try to continue the array by setting its
state to active.
  • Loading branch information
donald committed Mar 11, 2021
1 parent 029547e commit 22481ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mxraid/mdcheck.safe
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ do
rm -f $fl
continue;
fi
echo idle > $sys/md/sync_action
echo idle > $sys/md/sync_action &
pid=$!
sleep 10
if [ -d /proc/$pid -a "$(cat $sys/md/array_state)" = write-pending ]; then
logger -p daemon.info restart hanging $dev
echo active > $sys/md/array_state
fi
cat $sys/md/sync_min > $fl
logger -p daemon.info pause checking $dev at `cat $fl`
done

0 comments on commit 22481ce

Please sign in to comment.