From 6aebf70e18169e022c027c54268fa70cabeac918 Mon Sep 17 00:00:00 2001 From: Arye Yurkovsky Date: Mon, 8 Dec 2025 14:27:34 +0200 Subject: [PATCH] daemon: lvm_utils: Narrow stat failure to ENOENT And remove redundant parantheses. To only catch the failure we want to catch. --- daemon/lvm_utils.ml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon/lvm_utils.ml b/daemon/lvm_utils.ml index bd075b18f..6c32bf94f 100644 --- a/daemon/lvm_utils.ml +++ b/daemon/lvm_utils.ml @@ -36,11 +36,10 @@ open Utils let lv_canonical device = let stat1 = try Some (stat device) - with Unix_error _ -> None in + with Unix_error (ENOENT, _, _) -> None in match stat1 with | None -> None | Some stat1 -> - ( let lvs = Lvm.lvs () in try Some ( @@ -56,4 +55,3 @@ let lv_canonical device = ) with | Not_found -> None - )