Skip to content

Commit 8161168

Browse files
Ryan Moellertonyhutter
authored andcommitted
FreeBSD: Don't remove SA xattr if not SA znode
We attempt to remove an existing SA xattr when setting a dir xattr, but this only makes sense if the znode has been upgraded to the SA format. Otherwise, we will hit an assert in zfs_sa_get_xattr. Make sure this is an SA znode before attempting to remove the SA xattr. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes openzfs#12514
1 parent 72a989c commit 8161168

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/os/freebsd/zfs/zfs_vnops_os.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5695,7 +5695,7 @@ zfs_setextattr(struct vop_setextattr_args *ap)
56955695
}
56965696
if (error) {
56975697
error = zfs_setextattr_dir(ap, attrname);
5698-
if (error == 0)
5698+
if (error == 0 && zp->z_is_sa)
56995699
/*
57005700
* Successfully put into dir, we need to clear the one
57015701
* in SA if present.

0 commit comments

Comments
 (0)