From patchwork Thu Jun 6 21:27:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 65202 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 278F127BBEA; Thu, 6 Jun 2024 22:50:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A7EE727BBE9 for ; Thu, 6 Jun 2024 22:50:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFKzV-00064c-BN; Thu, 06 Jun 2024 17:49:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFKzT-00064S-Vb for guix-patches@gnu.org; Thu, 06 Jun 2024 17:49:48 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFKzT-0000z2-O5 for guix-patches@gnu.org; Thu, 06 Jun 2024 17:49:47 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFKzi-0000Og-Gq for guix-patches@gnu.org; Thu, 06 Jun 2024 17:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71402] [PATCH] services: Never throw when stopping mount-may-fail file systems. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jun 2024 21:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71402 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71402@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17177105631418 (code B ref -1); Thu, 06 Jun 2024 21:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jun 2024 21:49:23 +0000 Received: from localhost ([127.0.0.1]:43787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFKz1-0000MY-Th for submit@debbugs.gnu.org; Thu, 06 Jun 2024 17:49:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:40446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFKyy-0000M5-24 for submit@debbugs.gnu.org; Thu, 06 Jun 2024 17:49:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFKeQ-0002U2-E0 for guix-patches@gnu.org; Thu, 06 Jun 2024 17:28:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFKeP-0004Da-FT; Thu, 06 Jun 2024 17:28:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=UHAwyw6yOR98j8HXQxw2KH6zgChQahfz1Arv9ZfKpjo=; b=lsF7F+xYT1eLIT vFE76MCt8XAWV3ARnwUqZQlv5OmiOPyeEfMVEvlN8FdG15efwXp5Ri8PdUF8hv3B+eIZDUKP55UNH +d/jQIR040Sbr9BA1Bi/4vzPcRU3PXbJdVZd76udiuy5sji/sKjFnOWz0LSKPd7UR6aa8jZKop0x0 ODbcx+OftxRBg/0gededBg7iBTEKQcAsQlvSQ84CSO6q1Ili7tlhZ7tNK43SmDsjpwUn31ptNz/hq 0zmz4VJFeEOCJCGYdjmYMri3AUyY++L0AEGEgN80ig1VpVZYDvqsbaw5Y3CkAGswJ4FvwcNrxsD7n pGj0MoRjhR6z1fTUSIsA==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Thu, 6 Jun 2024 23:27:48 +0200 Message-ID: <559a95a6e1df354eb1415fa78163a8d3f009c61a.1717709187.git.ludo@gnu.org> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches This is a followup to 7c27bd115b14afd142da7684cc349369965f9eab. * gnu/services/base.scm (file-system-shepherd-service): Catch 'system-error from ‘umount’ call when FILE-SYSTEM is marked as mount-may-fail. Change-Id: I2234f8da320b43089f4ee058cad8608ce9c078f8 --- gnu/services/base.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Hi! File systems marked as mount-may-fail could throw when stopped (when the file system hadn't actually been mount). This was mostly harmless, but it should be ignored as well. Thoughts? Ludo'. base-commit: 40c6f708393885a2d28f847350e8f47beb11e745 diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 2d6b0f00e02..c7a14c7ed43 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -448,7 +448,11 @@ (define (file-system-shepherd-service file-system) ;; Make sure PID 1 doesn't keep TARGET busy. (chdir "/") - (umount #$target) + #$(if (file-system-mount-may-fail? file-system) + #~(catch 'system-error + (lambda () (umount #$target)) + (const #f)) + #~(umount #$target)) #f)) ;; We need additional modules.