Skip to content

Commit

Permalink
Fix sa.c to build on FreeBSD again. (openzfs#16403)
Browse files Browse the repository at this point in the history
Fix multiple build errors on FreeBSD.

The main reason is, that the variable 'dxattr_obj' is used
uninitialized within the start of the 'out label'.

Signed-off-by: Tino Reichardt <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
  • Loading branch information
mcmilk authored and lundman committed Sep 4, 2024
1 parent 86fcc70 commit 50c2231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,8 @@ sa_add_projid(sa_handle_t *hdl, dmu_tx_t *tx, uint64_t projid)
uint64_t crtime[2], mtime[2], ctime[2], atime[2];
zfs_acl_phys_t znode_acl = { 0 };
char scanstamp[AV_SCANSTAMP_SZ];
char *dxattr_obj = NULL;
int dxattr_size = 0;

if (zp->z_acl_cached == NULL) {
zfs_acl_t *aclp;
Expand Down Expand Up @@ -1659,8 +1661,6 @@ sa_add_projid(sa_handle_t *hdl, dmu_tx_t *tx, uint64_t projid)
if (err != 0 && err != ENOENT)
goto out;

char *dxattr_obj = NULL;
int dxattr_size = 0;
err = sa_size_locked(hdl, SA_ZPL_DXATTR(zfsvfs), &dxattr_size);
if (err != 0 && err != ENOENT)
goto out;
Expand Down

0 comments on commit 50c2231

Please sign in to comment.