Skip to content

Commit

Permalink
Use directory xattrs for symlinks
Browse files Browse the repository at this point in the history
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 <behlendorf1@llnl.gov>
Issue #1468
  • Loading branch information
behlendorf committed Aug 22, 2013
1 parent c273d60 commit 6a7c0cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/zfs/zpl_xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ zpl_xattr_set_sa(struct inode *ip, const char *name, const void *value,
if (error == -ENOENT)
error = zpl_xattr_set_dir(ip, name, NULL, 0, flags, cr);
} else {
/* Do not allow SA xattrs in symlinks (issue #1648) */
if (S_ISLNK(ip->i_mode))
return (-EMLINK);

/* Limited to 32k to keep nvpair memory allocations small */
if (size > DXATTR_MAX_ENTRY_SIZE)
return (-EFBIG);
Expand Down

0 comments on commit 6a7c0cc

Please sign in to comment.