Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4674,7 +4674,7 @@ vdev_clear(spa_t *spa, vdev_t *vd)
vd->vdev_stat.vs_checksum_errors = 0;
vd->vdev_stat.vs_dio_verify_errors = 0;
vd->vdev_stat.vs_slow_ios = 0;
atomic_store_64(&vd->vdev_outlier_count, 0);
atomic_store_64((volatile uint64_t *)&vd->vdev_outlier_count, 0);
vd->vdev_read_sit_out_expire = 0;

for (int c = 0; c < vd->vdev_children; c++)
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/mmap_seek.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ seek_expect(int fd, off_t offset, int whence, off_t expect_offset)
return;

int err = errno;
fprintf(stderr, "lseek(fd, %ld, SEEK_%s) = %ld (expected %ld)",
fprintf(stderr, "lseek(fd, %jd, SEEK_%s) = %jd (expected %jd)",
offset, (whence == SEEK_DATA ? "DATA" : "HOLE"),
seek_offset, expect_offset);
Comment on lines +58 to 60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formally I think %jd is uintmax_t, which might be bigger than off_t.

Copy link
Contributor Author

@mmatuska mmatuska Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is then the correct solution? I followed the guidelines in the linux off_t(3type) manpage

Linux manpage for off_t(3type):

To print a value of an integer type that doesn't have a length modifier, it should be converted to intmax_t or uintmax_t by an explicit cast.

Reference: https://man7.org/linux/man-pages/man3/off_t.3type.html

           "off_t max       %20jd %16jx\n" /* try PRIdMAX if %jd unsupported */

Reference: https://www.pixelbeat.org/programming/gcc/int_types/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it using %jd is the preferred solution, and it's what we've done in at least one other place (e.g. in tests/zfs-tests/cmd/clonefile.c). This looks good to me.

if (err != 0)
Expand Down
Loading