Skip to content

Commit 6a7c0cc

Browse files
committed
Use directory xattrs for symlinks
There is currently a subtle bug in the SA implementation which can crop up which prevents us from safely using multiple variable length SAs in one object. Fortunately, the only existing use case for this are symlinks with SA based xattrs. Therefore, until the root cause in the SA code can be identified and fixed we prevent adding SA xattrs to symlinks. Signed-off-by: Brian Behlendorf <[email protected]> Issue #1468
1 parent c273d60 commit 6a7c0cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

module/zfs/zpl_xattr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,10 @@ zpl_xattr_set_sa(struct inode *ip, const char *name, const void *value,
438438
if (error == -ENOENT)
439439
error = zpl_xattr_set_dir(ip, name, NULL, 0, flags, cr);
440440
} else {
441+
/* Do not allow SA xattrs in symlinks (issue #1648) */
442+
if (S_ISLNK(ip->i_mode))
443+
return (-EMLINK);
444+
441445
/* Limited to 32k to keep nvpair memory allocations small */
442446
if (size > DXATTR_MAX_ENTRY_SIZE)
443447
return (-EFBIG);

0 commit comments

Comments
 (0)