aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-10-21 10:58:36 +0200
committerKarel Zak <kzak@redhat.com>2025-10-21 11:17:47 +0200
commit19cd36ebc2e227b2a93c70207b213da58f7be5e2 (patch)
tree2295ae760423019359ce89e9ed9fe84bf54b9d07
parent7190e6a44e366f4daddad0930500de49f402c60e (diff)
downloadutil-linux-19cd36ebc2e227b2a93c70207b213da58f7be5e2.tar.gz
lostup: report EACCES on loop-control
Don't start scanning /dev/loop* after a failed access to /dev/loop-control. It's a waste of time, and the user does not receive a relevant error message. Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--lib/loopdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 7ba425e7cd..389cb100ee 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -1747,7 +1747,7 @@ int loopcxt_find_unused(struct loopdev_cxt *lc)
DBG(CXT, ul_debugobj(lc, "find_unused by loop-control [rc=%d]", rc));
}
- if (rc < 0) {
+ if (rc < 0 && rc != -EACCES) {
DBG(CXT, ul_debugobj(lc, "using loop scan"));
rc = loopcxt_init_iterator(lc, LOOPITER_FL_FREE);
if (rc)