]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Don't fail when we're unable to read file attributes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 5 Feb 2025 11:42:39 +0000 (12:42 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 5 Feb 2025 15:18:42 +0000 (16:18 +0100)
We're getting EOVERFLOW when reading file attributes trying to get
mkosi running in a docker container (don't ask). I have a suspicion
this is coming from fuse-overlayfs. Anyway, since the file attributes
stuff is supposed to be purely optional, let's not fail when we can't
read file attributes for whatever reason.

src/repart/repart.c

index 05b9f6d437362f6349be380b34d5cb5ac721d66e..1a5b485d5a1a59578e408a6128e339eb62332aec 100644 (file)
@@ -4327,7 +4327,7 @@ static int prepare_temporary_file(Context *context, PartitionTarget *t, uint64_t
 
         r = read_attr_fd(fdisk_get_devfd(context->fdisk_context), &attrs);
         if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r))
-                return log_error_errno(r, "Failed to read file attributes of %s: %m", arg_node);
+                log_warning_errno(r, "Failed to read file attributes of %s, ignoring: %m", arg_node);
 
         if (FLAGS_SET(attrs, FS_NOCOW_FL)) {
                 r = chattr_fd(fd, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
@@ -6637,7 +6637,7 @@ static int context_split(Context *context) {
 
                         r = read_attr_fd(fd, &attrs);
                         if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r))
-                                return log_error_errno(r, "Failed to read file attributes of %s: %m", arg_node);
+                                log_warning_errno(r, "Failed to read file attributes of %s, ignoring: %m", arg_node);
                 }
 
                 fdt = xopenat_full(
@@ -7507,7 +7507,7 @@ static int context_minimize(Context *context) {
 
         r = read_attr_fd(context->backing_fd, &attrs);
         if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r))
-                return log_error_errno(r, "Failed to read file attributes of %s: %m", arg_node);
+                log_warning_errno(r, "Failed to read file attributes of %s, ignoring: %m", arg_node);
 
         LIST_FOREACH(partitions, p, context->partitions) {
                 _cleanup_(rm_rf_physical_and_freep) char *root = NULL;