aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Moeller <ryan@iXsystems.com>2021-08-30 19:01:09 -0400
committerGitHub <noreply@github.com>2021-08-30 16:01:09 -0700
commit3b89d9518df2c7fd747e349873a3d4d498beb20e (patch)
treed9fe9927714fd084b722630616670527c4bafe1a
parentb1a1c64313c1cb2450b5fb6c3befe5c9e72a0b3e (diff)
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 <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #12514
-rw-r--r--module/os/freebsd/zfs/zfs_vnops_os.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c
index 3083b5381..61ff072b3 100644
--- a/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -5695,7 +5695,7 @@ zfs_setextattr(struct vop_setextattr_args *ap)
}
if (error) {
error = zfs_setextattr_dir(ap, attrname);
- if (error == 0)
+ if (error == 0 && zp->z_is_sa)
/*
* Successfully put into dir, we need to clear the one
* in SA if present.