Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeQL fixes #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/raidz_test/raidz_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ run_sweep(void)
opts = umem_zalloc(sizeof (raidz_test_opts_t), UMEM_NOFAIL);
opts->rto_ashift = ashift_v[a];
opts->rto_dcols = dcols_v[d];
opts->rto_offset = (1 << ashift_v[a]) * rand();
opts->rto_offset = (1ULL << ashift_v[a]) * rand();
opts->rto_dsize = size_v[s];
opts->rto_expand = rto_opts.rto_expand;
opts->rto_expand_offset = rto_opts.rto_expand_offset;
Expand Down
2 changes: 1 addition & 1 deletion lib/libefi/rdwr_efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ efi_write(int fd, struct dk_gpt *vtoc)
if (NBLOCKS(vtoc->efi_nparts, vtoc->efi_lbasize) < 34) {
dk_ioc.dki_length = EFI_MIN_ARRAY_SIZE + vtoc->efi_lbasize;
} else {
dk_ioc.dki_length = NBLOCKS(vtoc->efi_nparts,
dk_ioc.dki_length = (len_t)NBLOCKS(vtoc->efi_nparts,
vtoc->efi_lbasize) *
vtoc->efi_lbasize;
}
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5136,7 +5136,7 @@ arc_adapt(int bytes, arc_state_t *state)
if (!zfs_arc_p_dampener_disable)
mult = MIN(mult, 10); /* avoid wild arc_p adjustment */

arc_p = MIN(arc_c - arc_p_min, arc_p + bytes * mult);
arc_p = MIN(arc_c - arc_p_min, arc_p + (uint64_t)bytes * mult);
} else if (state == arc_mfu_ghost) {
uint64_t delta;

Expand Down
8 changes: 5 additions & 3 deletions tests/zfs-tests/cmd/stride_dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ main(int argc, char *argv[])
}

if (seek > 0) {
if (lseek(ofd, seek * bsize, SEEK_CUR) == -1) {
if (lseek(ofd, (uint64_t)seek * bsize, SEEK_CUR) == -1) {
perror("output lseek");
exit(2);
}
Expand Down Expand Up @@ -195,11 +195,13 @@ main(int argc, char *argv[])
}

if (stride > 1) {
if (lseek(ifd, (stride - 1) * bsize, SEEK_CUR) == -1) {
if (lseek(ifd, (stride - 1ULL) * bsize,
SEEK_CUR) == -1) {
perror("input lseek");
exit(2);
}
if (lseek(ofd, (stride - 1) * bsize, SEEK_CUR) == -1) {
if (lseek(ofd, (stride - 1ULL) * bsize,
SEEK_CUR) == -1) {
perror("output lseek");
exit(2);
}
Expand Down