]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
copy: Bubble up ENOSPC immediately in fd_copy_directory()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 12 Mar 2025 16:07:55 +0000 (17:07 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 Mar 2025 22:53:06 +0000 (07:53 +0900)
It doesn't really make sense to continue once we start getting ENOSPC.

src/shared/copy.c

index f9215da80541a089f03b47a2e4eb1fc51df0b335..09110bb0bd2631ce475f465eb144d923e04921dd 100644 (file)
@@ -1159,7 +1159,7 @@ static int fd_copy_directory(
                                          denylist, subvolumes, hardlink_context, child_display_path, progress_path,
                                          progress_bytes, userdata);
 
-                if (q == -EINTR) /* Propagate SIGINT/SIGTERM up instantly */
+                if (IN_SET(q, -EINTR, -ENOSPC)) /* Propagate SIGINT/SIGTERM and ENOSPC up instantly */
                         return q;
                 if (q == -EEXIST && (copy_flags & COPY_MERGE))
                         q = 0;