]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
raid6check.c, restripe.c: Use 64-bit off_t across both musl and glibc
authorAnkur Tyagi <ankur.tyagi85@gmail.com>
Mon, 26 Jan 2026 09:46:51 +0000 (22:46 +1300)
committerXiaoNi87 <xni@redhat.com>
Wed, 4 Feb 2026 13:30:02 +0000 (21:30 +0800)
This commit is adaptation of original patch[1] after commit[2] addressed
lseek issues.

[1] https://lore.kernel.org/linux-raid/20221110225546.337164-1-raj.khem@gmail.com/
[2] https://github.com/md-raid-utilities/mdadm/commit/787cc1b60130b8031be59e49d54463c58cd8cf74

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
raid6check.c
restripe.c

index 4469dc8fac5adf1e56365036311371c577664f00..fa50d44ed149faea22664d36a22f24127670ffb7 100644 (file)
@@ -288,7 +288,7 @@ int manual_repair(int chunk_size, int syndrome_disks,
        }
 
        int write_res1, write_res2;
-       off64_t seek_res;
+       off_t seek_res;
 
        seek_res = lseek(source[fd1], offsets[fd1] + start * chunk_size, SEEK_SET);
        if (seek_res < 0) {
@@ -381,7 +381,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
                        goto exitCheck;
                }
                for (i = 0 ; i < raid_disks ; i++) {
-                       off64_t seek_res = lseek(source[i], offsets[i] + start * chunk_size,
+                       off_t seek_res = lseek(source[i], offsets[i] + start * chunk_size,
                                                   SEEK_SET);
                        if (seek_res < 0) {
                                fprintf(stderr, "lseek to source %d failed\n", i);
index ec8d6275c4079b4bf910d085536a9b209898f1c4..58c0f5f56bcc924527c36bae345e712f687d6c82 100644 (file)
@@ -756,7 +756,7 @@ int restore_stripes(int *dest, unsigned long long *offsets,
                        if (src_buf == NULL) {
                                /* read from file */
                                if (lseek(source, read_offset, 0) !=
-                                        (off64_t)read_offset) {
+                                        (off_t)read_offset) {
                                        rv = -1;
                                        goto abort;
                                }