diff --git a/src/shared/loop-util.c b/src/shared/loop-util.c index 15f987604a..9349a98493 100644 --- a/src/shared/loop-util.c +++ b/src/shared/loop-util.c @@ -1233,6 +1233,9 @@ int loop_device_set_autoclear(LoopDevice *d, bool autoclear) { assert(d); + if (LOOP_DEVICE_IS_FOREIGN(d)) + return 0; + if (ioctl(ASSERT_FD(d->fd), LOOP_GET_STATUS64, &info) < 0) return -errno;