opencurve / curve

Curve is a sandbox project hosted by the CNCF Foundation. It's cloud-native, high-performance, and easy to operate. Curve is an open-source distributed storage system for block and shared file storage.
https://opencurve.io
Apache License 2.0
2.32k stars 521 forks source link

cp -a will trigger alarm information #2959

Open SeanHai opened 9 months ago

SeanHai commented 9 months ago

Describe the bug (描述bug)

client.yaml: fs.disableXattr: true

We return NO_DATA not NOT_SUPPORT when disable xattr may lead to semantic inconsistency.

cp -a file /fuse/mnt

cp: preserving permissions for ‘./client.yaml’: No data available

strace:

lstat("/home/wanghai01/client.yaml", {st_mode=S_IFREG|0644, st_size=1441, ...}) = 0
stat("./client.yaml", 0x7ffcbf03b380)   = -1 ENOENT (No such file or directory)
open("/home/wanghai01/client.yaml", O_RDONLY|O_NOFOLLOW) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1441, ...}) = 0
open("./client.yaml", O_WRONLY|O_CREAT|O_EXCL, 0600) = 4
fstat(4, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
fadvise64(3, 0, 0, POSIX_FADV_SEQUENTIAL) = 0
mmap(NULL, 139264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f144b531000
read(3, "kind: curvefs\n#container_image: "..., 131072) = 1441
write(4, "kind: curvefs\n#container_image: "..., 1441) = 1441
read(3, "", 131072)                     = 0
utimensat(4, NULL, [{tv_sec=1702202627, tv_nsec=672173499}, {tv_sec=1702202593, tv_nsec=420061736}], 0) = 0
fchown(4, 13019, 3000)                  = 0
flistxattr(3, NULL, 0)                  = 24
flistxattr(3, "system.posix_acl_access\0", 24) = 24
open("/etc/xattr.conf", O_RDONLY)       = -1 ENOENT (No such file or directory)
fgetxattr(3, "system.posix_acl_access", NULL, 0) = 36
fgetxattr(3, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377\20\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 36) = 36
fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377\20\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 36, 0) = -1 ENODATA (No data available)
fgetxattr(3, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377\20\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 132) = 36
fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377\20\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 36, 0) = -1 ENODATA (No data available)
fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 ENODATA (No data available)
fchmod(4, 0100644)

access log:

[2023-12-11 14:30:37.396] [fuse_access] [info] getattr (11534396): OK (11534396,[drwxr-xr-x:0040755,7,13019,3000,1702202692,1702276234,1702276234,4096]) <0.000331>
[2023-12-11 14:30:37.397] [fuse_access] [info] lookup (11534396,client.yaml): inode or dentry not exist <0.000451>
[2023-12-11 14:30:37.397] [fuse_access] [info] lookup (11534396,client.yaml): inode or dentry not exist <0.000259>
[2023-12-11 14:30:37.398] [fuse_access] [info] create (11534396,client.yaml): OK (2097251,[-rw-------:0100600,1,0,0,1702276237,1702276237,1702276237,0]) [fh:0] <0.001065>
[2023-12-11 14:30:37.398] [fuse_access] [info] getxattr (2097251,security.capability,0): no data available (0) <0.000006>
[2023-12-11 14:30:37.398] [fuse_access] [info] write (2097251,1441,0,0): OK (1441) <0.000076>
[2023-12-11 14:30:37.399] [fuse_access] [info] setattr (2097251,0x30): OK (2097251,[-rw-------:0100600,1,0,0,1702202627,1702202593,1702276237,1441]) <0.000359>
[2023-12-11 14:30:37.399] [fuse_access] [info] getxattr (2097251,security.capability,0): no data available (0) <0.000005>
[2023-12-11 14:30:37.399] [fuse_access] [info] getattr (2097251): OK (2097251,[-rw-------:0100600,1,0,0,1702202627,1702202593,1702276237,1441]) <0.000139>
[2023-12-11 14:30:37.399] [fuse_access] [info] setattr (2097251,0x6): OK (2097251,[-rw-------:0100600,1,13019,3000,1702202627,1702202593,1702276237,1441]) <0.000349>
[2023-12-11 14:30:37.400] [fuse_access] [info] setxattr (2097251,system.posix_acl_access,36,0): no data available <0.000005>
[2023-12-11 14:30:37.400] [fuse_access] [info] setxattr (2097251,system.posix_acl_access,36,0): no data available <0.000004>
[2023-12-11 14:30:37.400] [fuse_access] [info] setxattr (2097251,system.posix_acl_access,28,0): no data available <0.000006>
[2023-12-11 14:30:37.400] [fuse_access] [info] setattr (2097251,0x1): OK (2097251,[-rw-r--r--:0100644,1,13019,3000,1702202627,1702202593,1702276237,1441]) <0.000352>
[2023-12-11 14:30:37.405] [fuse_access] [info] flush (2097251,0): OK <0.003839>
[2023-12-11 14:30:37.405] [fuse_access] [info] release (2097251,0): OK <0.000005>

To Reproduce (复现方法)

Expected behavior (期望行为)

Versions (各种版本) OS: Compiler: branch: commit id:

Additional context/screenshots (更多上下文/截图)