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

Resolve various build issues #13575

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion cmd/zfs/zfs_main.c
Expand Up @@ -2441,7 +2441,7 @@ upgrade_set_callback(zfs_handle_t *zhp, void *data)

/* upgrade */
if (version < cb->cb_version) {
char verstr[16];
char verstr[24];
(void) snprintf(verstr, sizeof (verstr),
"%llu", (u_longlong_t)cb->cb_version);
if (cb->cb_lastfs[0] && !same_pool(zhp, cb->cb_lastfs)) {
Expand Down
14 changes: 10 additions & 4 deletions cmd/zfs/zfs_project.c
Expand Up @@ -207,7 +207,6 @@ static int
zfs_project_handle_dir(const char *name, zfs_project_control_t *zpc,
list_t *head)
{
char fullname[PATH_MAX];
struct dirent *ent;
DIR *dir;
int ret = 0;
Expand All @@ -227,21 +226,28 @@ zfs_project_handle_dir(const char *name, zfs_project_control_t *zpc,
zpc->zpc_ignore_noent = B_TRUE;
errno = 0;
while (!ret && (ent = readdir(dir)) != NULL) {
char *fullname;

/* skip "." and ".." */
if (strcmp(ent->d_name, ".") == 0 ||
strcmp(ent->d_name, "..") == 0)
continue;

if (strlen(ent->d_name) + strlen(name) >=
sizeof (fullname) + 1) {
if (strlen(ent->d_name) + strlen(name) + 1 >= PATH_MAX) {
errno = ENAMETOOLONG;
break;
}

sprintf(fullname, "%s/%s", name, ent->d_name);
if (asprintf(&fullname, "%s/%s", name, ent->d_name) == -1) {
errno = ENOMEM;
break;
}

ret = zfs_project_handle_one(fullname, zpc);
if (!ret && zpc->zpc_recursive && ent->d_type == DT_DIR)
zfs_project_item_alloc(head, fullname);

free(fullname);
}

if (errno && !ret) {
Expand Down
23 changes: 23 additions & 0 deletions config/always-compiler-options.m4
Expand Up @@ -204,6 +204,29 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH], [
AC_SUBST([IMPLICIT_FALLTHROUGH])
])

dnl #
dnl # Check if cc supports -Winfinite-recursion option.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION], [
AC_MSG_CHECKING([whether $CC supports -Winfinite-recursion])

saved_flags="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Winfinite-recursion"

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
INFINITE_RECURSION=-Winfinite-recursion
AC_DEFINE([HAVE_INFINITE_RECURSION], 1,
[Define if compiler supports -Winfinite-recursion])
AC_MSG_RESULT([yes])
], [
INFINITE_RECURSION=
AC_MSG_RESULT([no])
])

CFLAGS="$saved_flags"
AC_SUBST([INFINITE_RECURSION])
])

dnl #
dnl # Check if cc supports -fno-omit-frame-pointer option.
dnl #
Expand Down
1 change: 1 addition & 0 deletions config/zfs-build.m4
Expand Up @@ -210,6 +210,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
AC_SUBST(CPU_COUNT)

ZFS_AC_CONFIG_ALWAYS_CC_NO_CLOBBERED
ZFS_AC_CONFIG_ALWAYS_CC_INFINITE_RECURSION
ZFS_AC_CONFIG_ALWAYS_CC_IMPLICIT_FALLTHROUGH
ZFS_AC_CONFIG_ALWAYS_CC_FRAME_LARGER_THAN
ZFS_AC_CONFIG_ALWAYS_CC_NO_FORMAT_TRUNCATION
Expand Down
11 changes: 10 additions & 1 deletion include/sys/zil.h
Expand Up @@ -223,6 +223,15 @@ typedef struct {
uint64_t lr_foid; /* object id */
} lr_ooo_t;

/*
* Additional lr_attr_t fields.
*/
typedef struct {
uint64_t lr_attr_attrs; /* all of the attributes */
uint64_t lr_attr_crtime[2]; /* create time */
uint8_t lr_attr_scanstamp[32];
} lr_attr_end_t;

/*
* Handle option extended vattr attributes.
*
Expand All @@ -233,7 +242,7 @@ typedef struct {
typedef struct {
uint32_t lr_attr_masksize; /* number of elements in array */
uint32_t lr_attr_bitmap; /* First entry of array */
/* remainder of array and any additional fields */
/* remainder of array and additional lr_attr_end_t fields */
} lr_attr_t;

/*
Expand Down
2 changes: 1 addition & 1 deletion module/icp/algs/edonr/edonr.c
Expand Up @@ -491,7 +491,7 @@ EdonRInit(EdonRState *state, size_t hashbitlen)
state->hashbitlen = 512;
state->bits_processed = 0;
state->unprocessed_bits = 0;
memcpy(hashState224(state)->DoublePipe, i512p2,
memcpy(hashState512(state)->DoublePipe, i512p2,
sizeof (i512p2));
break;
}
Expand Down
24 changes: 12 additions & 12 deletions module/icp/asm-x86_64/aes/aes_aesni.S
Expand Up @@ -208,7 +208,7 @@ _key_expansion_256a_local:
pxor %xmm1, %xmm0
movups %xmm0, (%rcx)
add $0x10, %rcx
ret
RET
nop
SET_SIZE(_key_expansion_128)
SET_SIZE(_key_expansion_256a)
Expand Down Expand Up @@ -236,7 +236,7 @@ _key_expansion_192a_local:
shufps $0b01001110, %xmm2, %xmm1
movups %xmm1, 0x10(%rcx)
add $0x20, %rcx
ret
RET
SET_SIZE(_key_expansion_192a)


Expand All @@ -257,7 +257,7 @@ _key_expansion_192b_local:

movups %xmm0, (%rcx)
add $0x10, %rcx
ret
RET
SET_SIZE(_key_expansion_192b)


Expand All @@ -271,7 +271,7 @@ _key_expansion_256b_local:
pxor %xmm1, %xmm2
movups %xmm2, (%rcx)
add $0x10, %rcx
ret
RET
SET_SIZE(_key_expansion_256b)


Expand Down Expand Up @@ -376,7 +376,7 @@ rijndael_key_setup_enc_intel_local:
mov $14, %rax // return # rounds = 14
#endif
FRAME_END
ret
RET

.align 4
.Lenc_key192:
Expand Down Expand Up @@ -413,7 +413,7 @@ rijndael_key_setup_enc_intel_local:
mov $12, %rax // return # rounds = 12
#endif
FRAME_END
ret
RET

.align 4
.Lenc_key128:
Expand Down Expand Up @@ -453,13 +453,13 @@ rijndael_key_setup_enc_intel_local:
mov $10, %rax // return # rounds = 10
#endif
FRAME_END
ret
RET

.Lenc_key_invalid_param:
#ifdef OPENSSL_INTERFACE
mov $-1, %rax // user key or AES key pointer is NULL
FRAME_END
ret
RET
#else
/* FALLTHROUGH */
#endif /* OPENSSL_INTERFACE */
Expand All @@ -471,7 +471,7 @@ rijndael_key_setup_enc_intel_local:
xor %rax, %rax // a key pointer is NULL or invalid keysize
#endif /* OPENSSL_INTERFACE */
FRAME_END
ret
RET
SET_SIZE(rijndael_key_setup_enc_intel)


Expand Down Expand Up @@ -548,7 +548,7 @@ FRAME_BEGIN
// OpenSolaris: rax = # rounds (10, 12, or 14) or 0 for error
// OpenSSL: rax = 0 for OK, or non-zero for error
FRAME_END
ret
RET
SET_SIZE(rijndael_key_setup_dec_intel)


Expand Down Expand Up @@ -655,7 +655,7 @@ ENTRY_NP(aes_encrypt_intel)
aesenclast %KEY, %STATE // last round
movups %STATE, (%OUTP) // output

ret
RET
SET_SIZE(aes_encrypt_intel)


Expand Down Expand Up @@ -738,7 +738,7 @@ ENTRY_NP(aes_decrypt_intel)
aesdeclast %KEY, %STATE // last round
movups %STATE, (%OUTP) // output

ret
RET
SET_SIZE(aes_decrypt_intel)

#endif /* lint || __lint */
Expand Down
4 changes: 2 additions & 2 deletions module/icp/asm-x86_64/aes/aes_amd64.S
Expand Up @@ -785,7 +785,7 @@ ENTRY_NP(aes_encrypt_amd64)
mov 2*8(%rsp), %rbp
mov 3*8(%rsp), %r12
add $[4*8], %rsp
ret
RET

SET_SIZE(aes_encrypt_amd64)

Expand Down Expand Up @@ -896,7 +896,7 @@ ENTRY_NP(aes_decrypt_amd64)
mov 2*8(%rsp), %rbp
mov 3*8(%rsp), %r12
add $[4*8], %rsp
ret
RET

SET_SIZE(aes_decrypt_amd64)
#endif /* lint || __lint */
Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/blake3/blake3_avx2.S
Expand Up @@ -1334,7 +1334,7 @@ zfs_blake3_hash_many_avx2:
pop r13
pop r14
pop r15
ret
RET
.p2align 5
3:
mov rbx, qword ptr [rbp+0x50]
Expand Down
6 changes: 3 additions & 3 deletions module/icp/asm-x86_64/blake3/blake3_avx512.S
Expand Up @@ -1116,7 +1116,7 @@ zfs_blake3_hash_many_avx512:
pop r13
pop r14
pop r15
ret
RET
.p2align 6
3:
test esi, 0x8
Expand Down Expand Up @@ -2487,7 +2487,7 @@ zfs_blake3_compress_in_place_avx512:
vpxor xmm1, xmm1, xmm3
vmovdqu xmmword ptr [rdi], xmm0
vmovdqu xmmword ptr [rdi+0x10], xmm1
ret
RET

.p2align 6
zfs_blake3_compress_xof_avx512:
Expand Down Expand Up @@ -2573,7 +2573,7 @@ zfs_blake3_compress_xof_avx512:
vmovdqu xmmword ptr [r9+0x10], xmm1
vmovdqu xmmword ptr [r9+0x20], xmm2
vmovdqu xmmword ptr [r9+0x30], xmm3
ret
RET

.size zfs_blake3_hash_many_avx512, . - zfs_blake3_hash_many_avx512
.size zfs_blake3_compress_in_place_avx512, . - zfs_blake3_compress_in_place_avx512
Expand Down
6 changes: 3 additions & 3 deletions module/icp/asm-x86_64/blake3/blake3_sse2.S
Expand Up @@ -1671,7 +1671,7 @@ zfs_blake3_hash_many_sse2:
pop r13
pop r14
pop r15
ret
RET
.p2align 5
3:
test esi, 0x2
Expand Down Expand Up @@ -2157,7 +2157,7 @@ zfs_blake3_compress_in_place_sse2:
pxor xmm1, xmm3
movups xmmword ptr [rdi], xmm0
movups xmmword ptr [rdi+0x10], xmm1
ret
RET

.p2align 6
zfs_blake3_compress_xof_sse2:
Expand Down Expand Up @@ -2276,7 +2276,7 @@ zfs_blake3_compress_xof_sse2:
movups xmmword ptr [r9+0x10], xmm1
movups xmmword ptr [r9+0x20], xmm2
movups xmmword ptr [r9+0x30], xmm3
ret
RET

.size zfs_blake3_hash_many_sse2, . - zfs_blake3_hash_many_sse2
.size zfs_blake3_compress_in_place_sse2, . - zfs_blake3_compress_in_place_sse2
Expand Down
6 changes: 3 additions & 3 deletions module/icp/asm-x86_64/blake3/blake3_sse41.S
Expand Up @@ -1475,7 +1475,7 @@ zfs_blake3_hash_many_sse41:
pop r13
pop r14
pop r15
ret
RET
.p2align 5
3:
test esi, 0x2
Expand Down Expand Up @@ -1908,7 +1908,7 @@ zfs_blake3_compress_in_place_sse41:
pxor xmm1, xmm3
movups xmmword ptr [rdi], xmm0
movups xmmword ptr [rdi+0x10], xmm1
ret
RET
.p2align 6
zfs_blake3_compress_xof_sse41:
_CET_ENDBR
Expand Down Expand Up @@ -2015,7 +2015,7 @@ zfs_blake3_compress_xof_sse41:
movups xmmword ptr [r9+0x10], xmm1
movups xmmword ptr [r9+0x20], xmm2
movups xmmword ptr [r9+0x30], xmm3
ret
RET

.size zfs_blake3_hash_many_sse41, . - zfs_blake3_hash_many_sse41
.size zfs_blake3_compress_in_place_sse41, . - zfs_blake3_compress_in_place_sse41
Expand Down
6 changes: 3 additions & 3 deletions module/icp/asm-x86_64/modes/aesni-gcm-x86_64.S
Expand Up @@ -1201,7 +1201,7 @@ aesni_gcm_encrypt:
.align 32
clear_fpu_regs_avx:
vzeroall
ret
RET
.size clear_fpu_regs_avx,.-clear_fpu_regs_avx

/*
Expand All @@ -1219,7 +1219,7 @@ gcm_xor_avx:
movdqu (%rsi), %xmm1
pxor %xmm1, %xmm0
movdqu %xmm0, (%rsi)
ret
RET
.size gcm_xor_avx,.-gcm_xor_avx

/*
Expand All @@ -1236,7 +1236,7 @@ atomic_toggle_boolean_nv:
jz 1f
movl $1, %eax
1:
ret
RET
.size atomic_toggle_boolean_nv,.-atomic_toggle_boolean_nv

.align 64
Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/modes/gcm_pclmulqdq.S
Expand Up @@ -244,7 +244,7 @@ ENTRY_NP(gcm_mul_pclmulqdq)
//
// Return
//
ret
RET
SET_SIZE(gcm_mul_pclmulqdq)

#endif /* lint || __lint */
Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/sha2/sha256_impl.S
Expand Up @@ -2058,7 +2058,7 @@ ENTRY_NP(SHA256TransformBlocks)
.cfi_adjust_cfa_offset -8
.cfi_restore %rbx

ret
RET
.cfi_endproc
SET_SIZE(SHA256TransformBlocks)

Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/sha2/sha512_impl.S
Expand Up @@ -2059,7 +2059,7 @@ ENTRY_NP(SHA512TransformBlocks)
.cfi_adjust_cfa_offset -8
.cfi_restore %rbx

ret
RET
.cfi_endproc
SET_SIZE(SHA512TransformBlocks)

Expand Down