aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/linux/zfs/zpl_xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/os/linux/zfs/zpl_xattr.c')
-rw-r--r--module/os/linux/zfs/zpl_xattr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c
index 958af83ef..ebf0afc9e 100644
--- a/module/os/linux/zfs/zpl_xattr.c
+++ b/module/os/linux/zfs/zpl_xattr.c
@@ -153,19 +153,20 @@ static int
zpl_xattr_readdir(struct inode *dxip, xattr_filldir_t *xf)
{
zap_cursor_t zc;
- zap_attribute_t zap;
+ zap_attribute_t *zap = zap_attribute_alloc();
int error;
zap_cursor_init(&zc, ITOZSB(dxip)->z_os, ITOZ(dxip)->z_id);
- while ((error = -zap_cursor_retrieve(&zc, &zap)) == 0) {
+ while ((error = -zap_cursor_retrieve(&zc, zap)) == 0) {
- if (zap.za_integer_length != 8 || zap.za_num_integers != 1) {
+ if (zap->za_integer_length != 8 || zap->za_num_integers != 1) {
error = -ENXIO;
break;
}
- error = zpl_xattr_filldir(xf, zap.za_name, strlen(zap.za_name));
+ error = zpl_xattr_filldir(xf, zap->za_name,
+ strlen(zap->za_name));
if (error)
break;
@@ -173,6 +174,7 @@ zpl_xattr_readdir(struct inode *dxip, xattr_filldir_t *xf)
}
zap_cursor_fini(&zc);
+ zap_attribute_free(zap);
if (error == -ENOENT)
error = 0;