| 26 Oct 2021 |
das_j | you could `substituteInPlace src/copy.c --replace SEEK_HOLE 0? | 22:06:21 |
das_j | * you could substituteInPlace src/copy.c --replace SEEK_HOLE 0 | 22:06:24 |
das_j | ah wait its ifdef | 22:06:40 |
das_j | --replace "ifdef SEEK_HOLE" "if 0" is probably safer | 22:06:57 |
Ryan Burns | maybe just #undef it at the top | 22:07:06 |
Ryan Burns | well after the relevant includes | 22:07:16 |
moritz.hedtke | to be more idiot safe I just removed the whole sections (so played compiler a bit) | 22:09:12 |
das_j | looking at the SEEK_DATA macro we can probably just build without it until this is fixed | 22:13:26 |
das_j | it also disables SEEK_DATA when it cannot find Python | 22:13:53 |
moritz.hedtke | what is SEEK_DATA in relation to SEEK_HOLE? | 22:14:25 |
das_j | Seeking file data and holes
Since version 3.1, Linux supports the following additional values
for whence:
SEEK_DATA
Adjust the file offset to the next location in the file
greater than or equal to offset containing data. If
offset points to data, then the file offset is set to
offset.
SEEK_HOLE
Adjust the file offset to the next hole in the file
greater than or equal to offset. If offset points into
the middle of a hole, then the file offset is set to
offset. If there is no hole past offset, then the file
offset is adjusted to the end of the file (i.e., there is
an implicit hole at the end of any file).
| 22:14:50 |
das_j | the entire functionality in cp seems to be governed by the SEEK_DATA macro? | 22:16:02 |
das_j | * the entire functionality in cp seems to be governed by the SEEK_HOLE macro | 22:16:12 |
moritz.hedtke | Thanks! was mostly irritated by the word "macro" but now I understand how that works | 22:16:16 |
das_j | This is probably what's needed to disable lseek:
diff --git a/src/copy.c b/src/copy.c
index cb9018f93..2a4ccc061 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -502,7 +502,7 @@ write_zeros (int fd, off_t n_bytes)
return true;
}
-#ifdef SEEK_HOLE
+#if 0
/* Perform an efficient extent copy, if possible. This avoids
the overhead of detecting holes in hole-introducing/preserving
copy, and thus makes copying sparse files much more efficient.
@@ -1095,7 +1095,7 @@ infer_scantype (int fd, struct stat const *sb,
&& ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
return PLAIN_SCANTYPE;
-#ifdef SEEK_HOLE
+#if 0
scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
if (0 <= scan_inference->ext_start)
return LSEEK_SCANTYPE;
@@ -1377,7 +1377,7 @@ copy_reg (char const *src_name, char const *dst_name,
off_t n_read;
bool wrote_hole_at_eof = false;
if (! (
-#ifdef SEEK_HOLE
+#if 0
scantype == LSEEK_SCANTYPE
? lseek_copy (source_desc, dest_desc, buf, buf_size, hole_size,
scan_inference.ext_start, src_open_sb.st_size,
diff --git a/tests/seek-data-capable b/tests/seek-data-capable
index cc6372214..6e7a9ec1e 100644
--- a/tests/seek-data-capable
+++ b/tests/seek-data-capable
@@ -1,5 +1,7 @@
import sys, os, errno, platform
+sys.exit(1)
+
# Pass an _empty_ file
if len(sys.argv) != 2:
sys.exit(1)
| 22:27:45 |
das_j | I saved the mail draft and I'm going to open the bug report tomorrow at 12:00 (roughly, don't count on my timekeeping skills). The current version also mentions that the other two changes might not be related. If anyone can prove that one of the breakages I cannot reproduce is actually related to the same commit, I'll happily add it to the report :) Good night for now | 22:30:11 |
moritz.hedtke | Good night | 22:30:49 |
moritz.hedtke | I finished building with the SEEK_HOLE parts removed and peertube also built. /nix/store/8gbnwiv94i9ydrc0gxw7hz6wwcsk1gab-peertube-3.4.1. Whether that commit was the culprit or a nondeterministig bug in the compiler that is now hidden by a new random-seed I don't know. | 23:10:09 |
moritz.hedtke | For reference https://gist.github.com/mohe2015/15ab065023116b5770d66a6daa5c8a4a is the diff and I applied das_j's patch from above to coreutils to build from local. On top of v9.0 | 23:13:55 |
moritz.hedtke | * I finished building with the SEEK_HOLE parts removed and peertube also built. /nix/store/8gbnwiv94i9ydrc0gxw7hz6wwcsk1gab-peertube-3.4.1. Whether that commit was the culprit or a non-deterministic bug in the compiler that is now hidden by a new random-seed I don't know. | 23:15:55 |
| 27 Oct 2021 |
Vladimír Čunát | In reply to @janne.hess:helsinki-systems.de
This is probably what's needed to disable lseek:
diff --git a/src/copy.c b/src/copy.c
index cb9018f93..2a4ccc061 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -502,7 +502,7 @@ write_zeros (int fd, off_t n_bytes)
return true;
}
-#ifdef SEEK_HOLE
+#if 0
/* Perform an efficient extent copy, if possible. This avoids
the overhead of detecting holes in hole-introducing/preserving
copy, and thus makes copying sparse files much more efficient.
@@ -1095,7 +1095,7 @@ infer_scantype (int fd, struct stat const *sb,
&& ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
return PLAIN_SCANTYPE;
-#ifdef SEEK_HOLE
+#if 0
scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
if (0 <= scan_inference->ext_start)
return LSEEK_SCANTYPE;
@@ -1377,7 +1377,7 @@ copy_reg (char const *src_name, char const *dst_name,
off_t n_read;
bool wrote_hole_at_eof = false;
if (! (
-#ifdef SEEK_HOLE
+#if 0
scantype == LSEEK_SCANTYPE
? lseek_copy (source_desc, dest_desc, buf, buf_size, hole_size,
scan_inference.ext_start, src_open_sb.st_size,
diff --git a/tests/seek-data-capable b/tests/seek-data-capable
index cc6372214..6e7a9ec1e 100644
--- a/tests/seek-data-capable
+++ b/tests/seek-data-capable
@@ -1,5 +1,7 @@
import sys, os, errno, platform
+sys.exit(1)
+
# Pass an _empty_ file
if len(sys.argv) != 2:
sys.exit(1)
I also confirm that this patch fixes peertube build, atop staging-next. (same machine: all ext4 on LVM, x86_64-linux) | 07:46:30 |
das_j | In reply to @vcunat:matrix.org I also confirm that this patch fixes peertube build, atop staging-next. (same machine: all ext4 on LVM, x86_64-linux) Awesome! Thank you. The build fails because presumably a file is broken, right? It's not because cp fails in the build process? | 07:47:43 |
das_j | Also, is your /tmp on tmpfs? | 07:47:52 |
Vladimír Čunát | In reply to @janne.hess:helsinki-systems.de Also, is your /tmp on tmpfs? No, it's all ext4 on LVM. | 07:49:53 |
Vladimír Čunát | In reply to @janne.hess:helsinki-systems.de Awesome! Thank you. The build fails because presumably a file is broken, right? It's not because cp fails in the build process? I haven't poked into details of the error. It looks like it attempts some tests after build and those all end with
Error: The service is no longer running
| 07:50:38 |
das_j | In reply to @vcunat:matrix.org No, it's all ext4 on LVM. Umm, do you have time to check whether that also happens with boot.tmpOnTmpfs? | 08:08:35 |
das_j | Because that's one big difference between us. For you, it's the same filesystem, for me it's not | 08:08:56 |
das_j | If you don't have the time, this is the current draft: | 08:18:29 |
das_j | Redacted or Malformed Event | 08:18:32 |
Vladimír Čunát | In reply to @janne.hess:helsinki-systems.de Because that's one big difference between us. For you, it's the same filesystem, for me it's not Build on progress. (plain staging-next, all same except for tmpfs on /tmp) | 08:20:14 |