From 6c6a74f6159c620f092865b4a74d84bd0d2317ef Mon Sep 17 00:00:00 2001 From: Matti Hiljanen Date: Wed, 11 Feb 2026 10:52:52 +0200 Subject: [PATCH] nmdctl: handle_check: error out if in unattended mode and there is an paused operation pending --- tools/nmdctl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/nmdctl b/tools/nmdctl index a37a8a5..67d62f4 100644 --- a/tools/nmdctl +++ b/tools/nmdctl @@ -2625,6 +2625,10 @@ handle_check() { if [[ "$mdresync" -eq 0 ]] && [[ "$mdresyncpos" -gt 0 ]] && [[ "${option^^}" != "RESUME" ]]; then echo -e "${YELLOW}Warning: Previous resync operation $friendly_action is currently paused at $(( mdresyncpos * 100 / mdresyncsize ))%${NC}" echo -e "${YELLOW}You can resume it with ${GREEN}nmdctl check RESUME${NC}" + if [ "$UNATTENDED" -eq 1 ]; then + echo -e "${RED}Error: Cannot start new operation with a paused operation pending (unattended mode)${NC}" + return 1 + fi read -r -p "Are you sure you want to start a new operation without resuming? (y/N): " confirm if [[ ! "$confirm" =~ ^[Yy]$ ]]; then echo "Parity check cancelled by user"