From: Lennart Poettering Date: Wed, 3 Dec 2025 08:37:07 +0000 (+0100) Subject: mountfsd: allow O_NONBLOCK on image fds X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4f8be786ca788d1323bb46e1ac506f95ba325ed;p=thirdparty%2Fsystemd.git mountfsd: allow O_NONBLOCK on image fds Let's accept O_NONBLOCK on image fds. It's usually wise to open block device with O_NONBLOCK as it means that drivers with removable media won't block until a medium is inserted. Otherwise it has no effect. It also has no effect when opening regular files. Since block devices and raw devices are the only two things we accept in mountfsd, it's hence safe to allow it. --- diff --git a/src/mountfsd/mountwork.c b/src/mountfsd/mountwork.c index 0e0bd964eeb..4c321ce1c07 100644 --- a/src/mountfsd/mountwork.c +++ b/src/mountfsd/mountwork.c @@ -124,7 +124,7 @@ static int validate_image_fd(int fd, MountImageParameters *p) { return r; } - fl = fd_verify_safe_flags(fd); + fl = fd_verify_safe_flags_full(fd, O_NONBLOCK); if (fl < 0) return log_debug_errno(fl, "Image file descriptor has unsafe flags set: %m");