udev: downgrade ENOMEDIUM warnings
I noticed similar warnings in many VM boots: fedora (udev-worker)[475]: sr0: Failed to open device node: No medium found This particular one is from src/udev/udev-builtin-uaccess.c:125, but I think the same principle should be used in all places: if we are ignoring errors that the device has been removed, we should also ignore ENOMEDIUM.
This commit is contained in:
@@ -212,6 +212,13 @@ static inline bool ERRNO_IS_NEG_DEVICE_ABSENT(intmax_t r) {
|
||||
}
|
||||
_DEFINE_ABS_WRAPPER(DEVICE_ABSENT);
|
||||
|
||||
/* Device is absent or "empty". We get -ENOMEDIUM from CD/DVD devices, also in VMs. */
|
||||
static inline bool ERRNO_IS_NEG_DEVICE_ABSENT_OR_EMPTY(intmax_t r) {
|
||||
return ERRNO_IS_NEG_DEVICE_ABSENT(r) ||
|
||||
r == -ENOMEDIUM;
|
||||
}
|
||||
_DEFINE_ABS_WRAPPER(DEVICE_ABSENT_OR_EMPTY);
|
||||
|
||||
/* Quite often we want to handle cases where the backing FS doesn't support extended attributes at all and
|
||||
* where it simply doesn't have the requested xattr the same way */
|
||||
static inline bool ERRNO_IS_NEG_XATTR_ABSENT(intmax_t r) {
|
||||
|
||||
Reference in New Issue
Block a user