From patchwork Wed Aug 2 09:14:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 7062 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RG5rz2xnhz3wjw for ; Wed, 2 Aug 2023 09:14:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RG5rr3Ryzz1Q1; Wed, 2 Aug 2023 09:14:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RG5rq5BSdz2xdh; Wed, 2 Aug 2023 09:14:19 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RG5rn6s2tz2xdh for ; Wed, 2 Aug 2023 09:14:17 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RG5rn3JmNzcX; Wed, 2 Aug 2023 09:14:17 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4RG5rm59NGzTgsj; Wed, 2 Aug 2023 09:14:16 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/3] extrahd: Do not try to umount if nothing is mounted Date: Wed, 2 Aug 2023 09:14:15 +0000 Message-Id: <20230802091415.3168597-3-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802091415.3168597-1-michael.tremer@ipfire.org> References: <20230802091415.3168597-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- config/extrahd/extrahd.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index eba3f9b37..145a2a43a 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -80,6 +80,11 @@ extrahd_umount() { continue fi + # Do not try to umount if nothing is mounted + if ! mountpoint "${mountpoint}" &>/dev/null; then + continue + fi + # Umount and try lazy umount if failed if umount --quiet --recursive "${mountpoint}" || \ umount --quiet --recursive --lazy "${mountpoint}"; then