Open spuiuk opened 2 years ago
Notes:
To create a new share to test on the operator:
[root@smbshare3-0 /]# mkdir /share/
mkdir: cannot create directory ‘/share/’: File exists
[root@smbshare3-0 /]# chmod 777 /share
[root@smbshare3-0 /]# net conf addshare share /share writeable=y
[root@smbshare3-0 /]# net conf list
[global]
disable spoolss = yes
fileid:algorithm = fsid
load printers = no
printcap name = /dev/null
printing = bsd
smb ports = 445
vfs objects = fileid
netbios name = smbshare3
[smbshare3]
path = /mnt/dc189f61-d413-4b76-bb99-4b86beb30c0a
read only = no
[share]
path = /share
guest ok = no
read only = no
Reproducer:
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
int main( int argc, char **argv )
{
int fd;
if( argc < 2 ){
fprintf(stderr, "Usage %s <filename>\n\n",argv[0]);
exit(1);
}
if((fd = open( argv[1], O_CREAT| O_RDWR| O_EXCL, 0777)) == -1) {
fprintf(stderr,"Error opening file:%d: %s\n", errno, strerror(errno));
exit(2);
}
if(lseek(fd, 0xfffffff0000 - 1, SEEK_SET) == -1) {
fprintf(stderr,"Error seeking offset:%d: %s\n", errno, strerror(errno));
exit(2);
}
if(write(fd, "a", 1)) {
fprintf(stderr,"Error writing:%d: %s\n", errno, strerror(errno));
exit(2);
}
fprintf(stderr, " -- Done\n");
return 0;
}
On the container samba within the samba-operator
First with the cephfs share
[root@smbshare3-0 /]# grep /mnt /proc/mounts
10.111.173.90:6789,10.110.224.62:6789,10.101.104.103:6789:/volumes/csi/csi-vol-0cb59f87-c54e-11ec-ad3d-1e1dd7acb57d/ae264282-34b6-4255-a25c-6d8f60d9fc5e /mnt/dc189f61-d413-4b76-bb99-4b86beb30c0a ceph rw,relatime,name=csi-cephfs-node,secret=<hidden>,acl,mds_namespace=myfs 0 0
[root@smbshare3-0 /]# /tmp/write_test /mnt/dc189f61-d413-4b76-bb99-4b86beb30c0a/test
Error seeking offset:22: Invalid argument
Then on /tmp
[root@smbshare3-0 /]# /tmp/write_test /tmp/test
-- Done
[root@smbshare3-0 /]# ls -lh /tmp/test
-rwxr-xr-x 1 root root 16T May 1 13:51 /tmp/test
Reported for cephfs at https://tracker.ceph.com/issues/55510
@spuiuk wrote:
there was a comment this is a limitation imposed by the ceph MDS
by Jeff in the tracker and a suggested workaround. Not sure how applicable it is since it seems to involves a configuration change for the ceph setup ...
Yes. We either need to set this using the cephtool container or setup flapping.cephfs to ignore this for cephfs. We are sure to hit more such issues once we start testing cephfs with sit-test-cases.
When testing against the smb-operator samba server using a rook supplied cephfs pvc, we see a failure when running the smb2.rw.invalid test.
The part of the code with the failure is at
This is not seen with an ext4 underlying filesystem.
Versions: samba-4.15.6-0.fc35.x86_64
mount point: 10.111.173.90:6789,10.110.224.62:6789,10.101.104.103:6789:/volumes/csi/csi-vol-0cb59f87-c54e-11ec-ad3d-1e1dd7acb57d/ae264282-34b6-4255-a25c-6d8f60d9fc5e /mnt/dc189f61-d413-4b76-bb99-4b86beb30c0a ceph rw,relatime,name=csi-cephfs-node,secret=,acl,mds_namespace=myfs 0 0