diff options
author | Brian Behlendorf <[email protected]> | 2013-08-22 13:06:33 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-08-22 13:30:44 -0700 |
commit | 6a7c0ccca44ad02c476a111d8f7911fc8b12fff7 (patch) | |
tree | f63832fc8a8c4378f8be7919f206df6ddafc65e9 /module/zfs | |
parent | c273d60d80958dea8edc3c6f5702c9c81ffbd8ea (diff) |
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
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/zpl_xattr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c index dca1ad668..d79d35bce 100644 --- a/module/zfs/zpl_xattr.c +++ b/module/zfs/zpl_xattr.c @@ -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); |