Skip to content

Commit

Permalink
Advertise support for large xattrs on TrueNAS
Browse files Browse the repository at this point in the history
SB_LARGEXATTR is used in TrueNAS SCALE to indicate to the kernel
that the filesystem supports large-size xattrs (greater than 64KiB).

This flag is used to evaluate whether to allow large xattr read
or write requests (up to 2 MiB).

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
  • Loading branch information
anodos325 authored and Ryan Moeller committed May 27, 2021
1 parent b9a7340 commit b4f5042
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/os/linux/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,15 @@ xattr_changed_cb(void *arg, uint64_t newval)
zfsvfs_t *zfsvfs = arg;

if (newval == ZFS_XATTR_OFF) {
#ifdef SB_LARGEXATTR
zfsvfs->z_sb->s_flags &= ~SB_LARGEXATTR;
#endif
zfsvfs->z_flags &= ~ZSB_XATTR;
} else {
zfsvfs->z_flags |= ZSB_XATTR;
#ifdef SB_LARGEXATTR
zfsvfs->z_sb->s_flags |= SB_LARGEXATTR;
#endif

if (newval == ZFS_XATTR_SA)
zfsvfs->z_xattr_sa = B_TRUE;
Expand Down

0 comments on commit b4f5042

Please sign in to comment.