i_op->listxattr semantics
Hello all,
I am attempting to implement support for extended attributes in the Be Filesystem (befs) driver. But I am stuck trying to figure out why the getfattr program does not list my attributes.
Below is a test version of befs_listxattr that gives all files one attribute named "MyAttr". When I mount my filesystem on /befs (in 2.5.69-uml) and issue the command "getfattr -d /befs", no attributes are printed. The debugging statements appear in my syslog, so I know the function is being called.
Can anyone help me figure out what I am doing wrong? Thanks!
static ssize_tbefs_listxattr(struct dentry *dentry, char *buffer, size_t size)
{
struct super_block *sb = dentry->d_inode->i_sb;
ssize_t attr_len = 0;
char *attr = "MyAttr";
befs_debug(sb, "---> befs_listxattr for inode %lu "
"with %d buffer_size",
dentry->d_inode->i_ino, size);
attr_len = strlen(attr);
if (buffer) {
memcpy(buffer, attr, attr_len);
buffer[attr_len] = '\0';
}
befs_debug(sb, "<--- befs_listxattr");
return attr_len + 1;
}Signature · 2 lines
Will Dyson "Back off man, I'm a scientist!" -Dr. Peter Venkman
Quoted 6 lines · Will Dyson
Hello all,
I am attempting to implement support for extended attributes in the Be Filesystem (befs) driver. But I am stuck trying to figure out why the getfattr program does not list my attributes.
Quoted 7 lines
Below is a test version of
befs_listxattrthat gives all files one attribute named "MyAttr". When I mount my filesystem on /befs (in 2.5.69-uml) and issue the command "getfattr -d /befs", no attributes are printed. The debugging statements appear in my syslog, so I know the function is being called.Can anyone help me figure out what I am doing wrong? Thanks!
At first guess, probably the lack of a namespace prefix is causing your problem - see attr(5) and listxattr(2).
Quoted 6 lines
static
ssize_tbefs_listxattr(struct dentry *dentry, char *buffer, size_t size){ struct super_block *sb = dentry->d_inode->i_sb; ssize_t attr_len = 0; char *attr = "MyAttr";
Try 's/MyAttr/user.MyAttr/g' or whichever namespace is appropriate.
cheers.
Signature · 1 line
Nathan