extended attributes wiredness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am using kernel 3.7-rc6.

I have written a test application for extended attributes and have for
some folders a wired behaviour:

#include <stdio.h>
#include <string.h>
#include <attr/xattr.h>

char attrs[1024];
ssize_t attrslen;
int i;
char value[1024];
ssize_t valuelen;

int main(int argc, char *argv[])
{
  if (argc != 2)
  {
    fprintf(stderr, "Syntax: testxattr <filename>\n");

    return 1;
  }

  printf("processing file %s\n", argv[1]);

  attrslen = llistxattr(argv[1], attrs, 1024);

  if (attrslen < 0)
  {
    perror("listxattr failed");

    return 1;
  }

  for (i = 0; i < attrslen; i+= strlen(&attrs[i]) + 1)
  {
    printf("processing attribute %s\n", &attrs[i]);

    valuelen = lgetxattr(argv[1], &attrs[i], value, 1024);

    if (valuelen < 0);
    {
      perror("lgetxattr failed");

      return 1;
    }

    printf("value %.*s", (int) valuelen, value);
  }

  return 0;
}

is returning:

processing file /u00/root.20121121.210102.full/var/lib/nfs/sm
processing attribute system.posix_acl_default
lgetxattr failed: No data available

output of stat:

File: '/u00/root.20121121.210102.full/var/lib/nfs/sm'
Size: 94            Blocks: 0          IO Block: 4096   directory
Device: 3ah/58d    Inode: 1331353     Links: 1
Access: (0755/drwxr-xr-x)  Uid: (65534/  nobody)   Gid: (    0/    root)
Access: 2012-10-18 21:25:11.350000993 +0200
Modify: 2012-11-21 06:32:24.050210417 +0100
Change: 2012-11-21 06:32:24.050210417 +0100
Birth: -

Is this a bug in btrfs or do I miss something here ?

Thanks in advance,
David Arendt
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux