Introduce ERRNO_IS_FS_WRITE_REFUSED(), and use it in binfmt_mounted() (#38117)
- This introduces ERRNO_IS_FS_WRITE_REFUSED(), and apply it where usable. - This makes unexpected errors in access_fd() called by binfmt_mounted() propagated to the caller. - Renames binfmt_mounted() to binfmt_mounted_and_writable(), as it also checks the fs is writable. - Voidifies one disable_binfmt() call in shutdown.c.
This commit is contained in:
@@ -188,6 +188,12 @@ static inline bool ERRNO_IS_NEG_PRIVILEGE(intmax_t r) {
|
||||
}
|
||||
_DEFINE_ABS_WRAPPER(PRIVILEGE);
|
||||
|
||||
/* Three different errors for writing on a filesystem */
|
||||
static inline bool ERRNO_IS_NEG_FS_WRITE_REFUSED(intmax_t r) {
|
||||
return r == -EROFS || ERRNO_IS_NEG_PRIVILEGE(r);
|
||||
}
|
||||
_DEFINE_ABS_WRAPPER(FS_WRITE_REFUSED);
|
||||
|
||||
/* Three different errors for "not enough disk space" */
|
||||
static inline bool ERRNO_IS_NEG_DISK_SPACE(intmax_t r) {
|
||||
return IN_SET(r,
|
||||
|
||||
Reference in New Issue
Block a user