Discussion:
aufs 4.9 removexattr issue
Justin Cormack
2017-01-20 16:27:53 UTC
Permalink
removexattr seems to behave differently on aufs on kernel 4.9. Guessing
that this was missed in the xattr changes in the port.

doing a cp -rp on 4.4 kernel I got:

fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tt"..., 1024) = 462
read(3, "", 1024) = 0
close(3) = 0
geteuid() = 0
stat("/bar", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/bar/foo", 0x7ffdad662030) = -1 ENOENT (No such file or
directory)
mkdir("/bar/foo", 0700) = 0
lstat("/bar/foo", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
open("/foo", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(3, /* 2 entries */, 32768) = 48
getdents(3, /* 0 entries */, 32768) = 0
close(3) = 0
utimensat(AT_FDCWD, "/bar/foo", [{1484927717, 203576439}, {1484927716, 0}],
0) = 0
lchown("/bar/foo", 0, 0) = 0
getxattr("/foo", "system.posix_acl_access", 0x7ffdad661c30, 132) = -1
ENODATA (No data available)
stat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getxattr("/foo", "system.posix_acl_default", 0x7ffdad661c30, 132) = -1
ENODATA (No data available)
stat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
setxattr("/bar/foo", "system.posix_acl_access",
"\2\0\0\0\1\0\7\0\377\377\377\377\4\0\5\0\377\377\377\377
\0\5\0\377\377\377\377", 28, 0) = 0
removexattr("/bar/foo", "system.posix_acl_default") = 0

but on 4.9 I get:


fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tt"..., 1024) = 476
read(3, "", 1024) = 0
close(3) = 0
geteuid() = 0
stat("/bar", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/bar/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/foo", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(3, /* 2 entries */, 32768) = 48
getdents(3, /* 0 entries */, 32768) = 0
close(3) = 0
utimensat(AT_FDCWD, "/bar/foo", [{1484927717, 203576439}, {1484927716, 0}],
0) = 0
getxattr("/foo", "system.posix_acl_access", 0x7fff6a3446e0, 132) = -1
ENODATA (No data available)
stat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getxattr("/foo", "system.posix_acl_default", 0x7fff6a3446e0, 132) = -1
ENODATA (No data available)
stat("/foo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
setxattr("/bar/foo", "system.posix_acl_access",
"\2\0\0\0\1\0\7\0\377\377\377\377\4\0\5\0\377\377\377\377
\0\5\0\377\377\377\377", 28, 0) = 0
removexattr("/bar/foo", "system.posix_acl_default") = -1 EINVAL (Invalid
argument)
open("/usr/lib/x86_64-linux-gnu/charset.alias", O_RDONLY|O_NOFOLLOW) = -1
ENOENT (No such file or directory)
write(2, "cp: ", 4cp: ) = 4
write(2, "preserving permissions for '/bar"..., 37preserving permissions
for '/bar/foo') = 37
write(2, ": Invalid argument", 18: Invalid argument) = 18
write(2, "\n", 1

This makes the call fail, as removexattr is now returning EINVAL in 4.9

Both systems are running 20161219 aufs standalone
Yair Yarom
2017-01-22 14:27:49 UTC
Permalink
We're also seeing this issue, where removexattr returns EINVAL. Our ro
branch is nfs (without acl), and rw branch is tmpfs (without
xattr). Mounting with noacl or with +icex doesn't help. On kernel 4.8 it
worked fine.

Simply mv'ing a directory from ext4 to the aufs will complain:
$ mv /tmp/aaa /usr/
mv: preserving permissions for ‘/usr/aaa’: Invalid argument

Our kernel is 4.9.1 with the aufs patch (commit d75e77a on 4.9 branch)

Regards,
Yair.
s***@users.sourceforge.net
2017-01-22 18:48:00 UTC
Permalink
Hello Yair,
Post by Yair Yarom
We're also seeing this issue, where removexattr returns EINVAL. Our ro
branch is nfs (without acl), and rw branch is tmpfs (without
xattr). Mounting with noacl or with +icex doesn't help. On kernel 4.8 it
worked fine.
$ mv /tmp/aaa /usr/
mv: preserving permissions for =E2=80=98/usr/aaa=E2=80=99: Invalid argument
Our kernel is 4.9.1 with the aufs patch (commit d75e77a on 4.9 branch)
Thanx for the report.
I think I could see the scenario. Please test this patch.
You will need "acl" mount option for aufs to gain the full support of
posix-acl.

By the way, Justin's original post to this ML was not delivered to me. I
just got one line "cc @sfjro" msg from him, which was posted to
https://github.com/docker/docker/issues/30245. And I replied to github only.
Although I could read the same post on github, it was fortunate for me
that you replied to his post. Otherwise I could find the post much later.


J. R. Okajima
Yair Yarom
2017-01-23 15:50:51 UTC
Permalink
Thanks, the patch works for me (we're usually not using acl, and that's
what I've checked).

Yair.
Post by s***@users.sourceforge.net
Hello Yair,
Post by Yair Yarom
We're also seeing this issue, where removexattr returns EINVAL. Our ro
branch is nfs (without acl), and rw branch is tmpfs (without
xattr). Mounting with noacl or with +icex doesn't help. On kernel 4.8 it
worked fine.
$ mv /tmp/aaa /usr/
mv: preserving permissions for =E2=80=98/usr/aaa=E2=80=99: Invalid argument
Our kernel is 4.9.1 with the aufs patch (commit d75e77a on 4.9 branch)
Thanx for the report.
I think I could see the scenario. Please test this patch.
You will need "acl" mount option for aufs to gain the full support of
posix-acl.
By the way, Justin's original post to this ML was not delivered to me. I
https://github.com/docker/docker/issues/30245. And I replied to github only.
Although I could read the same post on github, it was fortunate for me
that you replied to his post. Otherwise I could find the post much later.
J. R. Okajima
s***@users.sourceforge.net
2017-01-23 19:34:00 UTC
Permalink
Post by Yair Yarom
Thanks, the patch works for me (we're usually not using acl, and that's
what I've checked).
Thanks.
The patch will be included in next aufs release after my local tests
which takes several days.


J. R. Okajima

Loading...