Discussion:
copy file
魏彦斌
2016-06-27 01:20:02 UTC
Permalink
I use aufs filesystem as rootfs filesystem. the kylin user is a normal user, tips information is wrong when I copy file to super user directory.
I use some command, like this.

***@kylin-os:~$ touch wyb
***@kylin-os:~$ cp wyb /etc
cp: cannot create regular file '/etc/wyb': File exists

but the information is wrong, this is normal information.
***@crystal:~$ touch wyb
***@crystal:~$ cp wyb /etc/
cp: cannot create regular file ‘/etc/wyb’: Permission denied
s***@users.sourceforge.net
2016-06-27 03:01:09 UTC
Permalink
Hello,
Post by 魏彦斌
I use aufs filesystem as rootfs filesystem. the kylin user is a normal
user, tips information is wrong when I copy file to super user directory.
I use some command, like this.
cp: cannot create regular file '/etc/wyb': File exists
I cannot reproduce.
Would you try "strace -o /tmp/s cp wyb /etc" and post /tmp/s file?
And these info are necessary.

(from aufs README)
- /proc/mounts (instead of the output of mount(8))
- /sys/module/aufs/*
- /sys/fs/aufs/* (if you have them)
- /debug/aufs/* (if you have them)
- linux kernel version
if your kernel is not plain, for example modified by distributor,
the url where i can download its source is necessary too.
- aufs version which was printed at loading the module or booting the
system, instead of the date you downloaded.
- configuration (define/undefine CONFIG_AUFS_xxx)
- kernel configuration or /proc/config.gz (if you have it)
- behaviour which you think to be incorrect
- actual operation, reproducible one is better
- mailto: aufs-users at lists.sourceforge.net


J. R. Okajima
魏彦斌
2016-06-27 05:57:50 UTC
Permalink
kernel info:
Linux kylin-Vostro-260s 4.4.0-21-generic #37kord1kylin20160514 SMP Wed May 18 10:18:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

/sys/module/aufs:
***@kylin-Vostro-260s:/sys/module/aufs$ ls
coresize holders initsize initstate notes parameters refcnt sections srcversion taint uevent version
***@kylin-Vostro-260s:/sys/module/aufs$ cat coresize
237568
***@kylin-Vostro-260s:/sys/module/aufs$ cat initsize
0
***@kylin-Vostro-260s:/sys/module/aufs$ cat initstate
live
***@kylin-Vostro-260s:/sys/module/aufs$ cat refcnt
3475
***@kylin-Vostro-260s:/sys/module/aufs$ cat srcversion
DA0A89DEEDADD82FB8A9636
***@kylin-Vostro-260s:/sys/module/aufs$ cat taint

***@kylin-Vostro-260s:/sys/module/aufs$ cat version
4.x-rcN-20160111
***@kylin-Vostro-260s:/sys/module/aufs$


this is mount information, I delete some cgroup and tmpfs info.
***@kylin-Vostro-260s:~$ cat /proc/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=924724k,nr_inodes=231181,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=189080k,mode=755 0 0
/dev/sda2 / aufs rw,relatime,si=9c2da998b3439525 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sda1 /boot ext4 rw,relatime,stripe=4,data=ordered 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=189080k,mode=700,uid=1000,gid=1000 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

AUFS configration:
CONFIG_AUFS_FS=m
# CONFIG_AUFS_BRANCH_MAX_127 is not set
# CONFIG_AUFS_BRANCH_MAX_511 is not set
CONFIG_AUFS_BRANCH_MAX_1023=y
# CONFIG_AUFS_BRANCH_MAX_32767 is not set
CONFIG_AUFS_SBILIST=y
CONFIG_AUFS_HNOTIFY=y
CONFIG_AUFS_HFSNOTIFY=y
CONFIG_AUFS_EXPORT=y
CONFIG_AUFS_INO_T_64=y
# CONFIG_AUFS_XATTR is not set
# CONFIG_AUFS_FHSM is not set
CONFIG_AUFS_RDU=y
CONFIG_AUFS_SHWH=y
CONFIG_AUFS_BR_RAMFS=y
CONFIG_AUFS_BR_FUSE=y
CONFIG_AUFS_POLL=y
CONFIG_AUFS_BR_HFSPLUS=y
CONFIG_AUFS_BDEV_LOOP=y

actual operation:
***@kylin-Vostro-260s:~$ ls /etc/wyb
ls: cannot access '/etc/wyb': No such file or directory
***@kylin-Vostro-260s:~$ touch wyb
***@kylin-Vostro-260s:~$ cp wyb /etc/
cp: cannot create regular file '/etc/wyb': File exists
here should point out permission deny.
maybe these info are not necessay, but these is wrong.


------------------ Original ------------------
From: "sfjro"<***@users.sourceforge.net>;
Date: Mon, Jun 27, 2016 11:01 AM
To: "魏圊斌"<***@kylinos.cn>;
Cc: "aufs-users"<aufs-***@lists.sourceforge.net>;
Subject: Re: copy file



Hello,
Post by 魏彦斌
I use aufs filesystem as rootfs filesystem. the kylin user is a normal
user, tips information is wrong when I copy file to super user directory.
I use some command, like this.
cp: cannot create regular file '/etc/wyb': File exists
I cannot reproduce.
Would you try "strace -o /tmp/s cp wyb /etc" and post /tmp/s file?
And these info are necessary.

(from aufs README)
- /proc/mounts (instead of the output of mount(8))
- /sys/module/aufs/*
- /sys/fs/aufs/* (if you have them)
- /debug/aufs/* (if you have them)
- linux kernel version
if your kernel is not plain, for example modified by distributor,
the url where i can download its source is necessary too.
- aufs version which was printed at loading the module or booting the
system, instead of the date you downloaded.
- configuration (define/undefine CONFIG_AUFS_xxx)
- kernel configuration or /proc/config.gz (if you have it)
- behaviour which you think to be incorrect
- actual operation, reproducible one is better
- mailto: aufs-users at lists.sourceforge.net


J. R. Okajima
魏彦斌
2016-06-27 06:37:33 UTC
Permalink
kernel info:
Linux kylin-Vostro-260s 4.4.0-21-generic #37kord1kylin20160514 SMP Wed May 18 10:18:49 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

/sys/module/aufs:
***@kylin-Vostro-260s:/sys/module/aufs$ ls
coresize holders initsize initstate notes parameters refcnt sections srcversion taint uevent version
***@kylin-Vostro-260s:/sys/module/aufs$ cat coresize
237568
***@kylin-Vostro-260s:/sys/module/aufs$ cat initsize
0
***@kylin-Vostro-260s:/sys/module/aufs$ cat initstate
live
***@kylin-Vostro-260s:/sys/module/aufs$ cat refcnt
3475
***@kylin-Vostro-260s:/sys/module/aufs$ cat srcversion
DA0A89DEEDADD82FB8A9636
***@kylin-Vostro-260s:/sys/module/aufs$ cat taint

***@kylin-Vostro-260s:/sys/module/aufs$ cat version
4.x-rcN-20160111
***@kylin-Vostro-260s:/sys/module/aufs$


this is mount information, I delete some cgroup and tmpfs info.
***@kylin-Vostro-260s:~$ cat /proc/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=924724k,nr_inodes=231181,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=189080k,mode=755 0 0
/dev/sda2 / aufs rw,relatime,si=9c2da998b3439525 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=24,pgrp=1,timeout=0,minproto=5,maxproto=5,direct 0 0
mqueue /dev/mqueue mqueue rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime 0 0
sunrpc /run/rpc_pipefs rpc_pipefs rw,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0
/dev/sda1 /boot ext4 rw,relatime,stripe=4,data=ordered 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=189080k,mode=700,uid=1000,gid=1000 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0

AUFS configration:
CONFIG_AUFS_FS=m
# CONFIG_AUFS_BRANCH_MAX_127 is not set
# CONFIG_AUFS_BRANCH_MAX_511 is not set
CONFIG_AUFS_BRANCH_MAX_1023=y
# CONFIG_AUFS_BRANCH_MAX_32767 is not set
CONFIG_AUFS_SBILIST=y
CONFIG_AUFS_HNOTIFY=y
CONFIG_AUFS_HFSNOTIFY=y
CONFIG_AUFS_EXPORT=y
CONFIG_AUFS_INO_T_64=y
# CONFIG_AUFS_XATTR is not set
# CONFIG_AUFS_FHSM is not set
CONFIG_AUFS_RDU=y
CONFIG_AUFS_SHWH=y
CONFIG_AUFS_BR_RAMFS=y
CONFIG_AUFS_BR_FUSE=y
CONFIG_AUFS_POLL=y
CONFIG_AUFS_BR_HFSPLUS=y
CONFIG_AUFS_BDEV_LOOP=y

actual operation:
***@kylin-Vostro-260s:~$ ls /etc/wyb
ls: cannot access '/etc/wyb': No such file or directory
***@kylin-Vostro-260s:~$ touch wyb
***@kylin-Vostro-260s:~$ cp wyb /etc/
cp: cannot create regular file '/etc/wyb': File exists
here should point out permission deny.
maybe these info are not necessay, but these is wrong.


here is "strace -o /tmp/s cp wyb /etc" info.
stat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("wyb", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
stat("/etc/wyb", 0x7ffc0c691890) = -1 ENOENT (No such file or directory)
open("wyb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
open("/etc/wyb", O_WRONLY|O_CREAT|O_EXCL, 0664) = -1 EEXIST (File exists)
lstat("/etc/wyb", 0x7ffc0c6919b0) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2995
read(4, "", 4096) = 0
close(4)


------------------ Original ------------------
From: "sfjro"<***@users.sourceforge.net>;
Date: Mon, Jun 27, 2016 11:01 AM
To: "魏圊斌"<***@kylinos.cn>;
Cc: "aufs-users"<aufs-***@lists.sourceforge.net>;
Subject: Re: copy file



Hello,
Post by 魏彦斌
I use aufs filesystem as rootfs filesystem. the kylin user is a normal
user, tips information is wrong when I copy file to super user directory.
I use some command, like this.
cp: cannot create regular file '/etc/wyb': File exists
I cannot reproduce.
Would you try "strace -o /tmp/s cp wyb /etc" and post /tmp/s file?
And these info are necessary.

(from aufs README)
- /proc/mounts (instead of the output of mount(8))
- /sys/module/aufs/*
- /sys/fs/aufs/* (if you have them)
- /debug/aufs/* (if you have them)
- linux kernel version
if your kernel is not plain, for example modified by distributor,
the url where i can download its source is necessary too.
- aufs version which was printed at loading the module or booting the
system, instead of the date you downloaded.
- configuration (define/undefine CONFIG_AUFS_xxx)
- kernel configuration or /proc/config.gz (if you have it)
- behaviour which you think to be incorrect
- actual operation, reproducible one is better
- mailto: aufs-users at lists.sourceforge.net


J. R. Okajima
s***@users.sourceforge.net
2016-06-27 10:47:23 UTC
Permalink
Post by 魏彦斌
coresize holders initsize initstate notes parameters refcnt sections srcversion taint uevent version
:::

Since you have /sys/module/aufs, you must have /sys/fs/aufs too, don't
you? I need them.
Post by 魏彦斌
4.x-rcN-20160111
Ok, this is half a year old version. But I don't think it matters
currently.
Post by 魏彦斌
/dev/sda2 / aufs rw,relatime,si=9c2da998b3439525 0 0
It looks really weird.
How did you mount your root?
Post by 魏彦斌
CONFIG_AUFS_FS=m
:::

Hmm, while CONFIG_AUFS_DEBUG line doesn't appear, I guess it is
disabled. If it was, then the module parameter 'debug' might be helpful
for such case.
Post by 魏彦斌
here is "strace -o /tmp/s cp wyb /etc" info.
stat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("wyb", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
stat("/etc/wyb", 0x7ffc0c691890) = -1 ENOENT (No such file or directory)
open("wyb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
open("/etc/wyb", O_WRONLY|O_CREAT|O_EXCL, 0664) = -1 EEXIST (File exists)
lstat("/etc/wyb", 0x7ffc0c6919b0) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
On my test system (which is current aufs4.x-rcN for linux-v4.7-rc4),
open() for the target returned EACCES (Permission denied)
expectedly.
And the following lstat() doesn't appear, but it may be just a
difference of /bin/cp.


J. R. Okajima

Loading...