diff options
author | Ryan Moeller <[email protected]> | 2021-08-30 19:01:09 -0400 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2021-09-14 15:11:56 -0700 |
commit | 81611683c87775a84b915dabc4c3b4f390236eb5 (patch) | |
tree | 69fdfe3044688f5794b01f6ba48149bb32585565 | |
parent | 72a989cf60b4c7b9a46dc5854c0bd2561ce6b576 (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 <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #12514
-rw-r--r-- | module/os/freebsd/zfs/zfs_vnops_os.c | 2 |
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 a18ac21dc..4672b9c2b 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. |