samba-operator icon indicating copy to clipboard operation
samba-operator copied to clipboard

smbtorture failure - smb2.rw.invalid

Open spuiuk opened this issue 3 years ago • 5 comments

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.

[root@smbclient samba-integration]# /bin/smbtorture --fullname --target=samba3 --user=sambauser%samba //10.244.2.14/smbshare3  smb2.rw.invalid
smbtorture 4.15.5
Using seed 1651410917
time: 2022-05-01 13:15:17.325545
test: smb2.rw.invalid
time: 2022-05-01 13:15:17.327756
dos charset 'CP850' unavailable - using ASCII
time: 2022-05-01 13:15:17.444662
failure: smb2.rw.invalid [
../../source4/torture/smb2/read_write.c:331: status was NT_STATUS_DISK_FULL, expected NT_STATUS_OK: Incorrect status
]

The part of the code with the failure is at

        w.in.file.handle = h;    
        w.in.offset = 0xfffffff0000 - 1; /* MAXFILESIZE - 1 */
        w.in.data.data = buf;
        w.in.data.length = 1;
        status = smb2_write(tree, &w);
        if (TARGET_IS_SAMBA3(torture) || TARGET_IS_SAMBA4(torture)) {
                CHECK_STATUS(status, NT_STATUS_OK);
                CHECK_VALUE(w.out.nwritten, 1);
        } else {
                CHECK_STATUS(status, NT_STATUS_DISK_FULL);
        }

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

spuiuk avatar May 01 '22 13:05 spuiuk

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

spuiuk avatar May 01 '22 13:05 spuiuk

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

spuiuk avatar May 01 '22 13:05 spuiuk

Reported for cephfs at https://tracker.ceph.com/issues/55510

spuiuk avatar May 01 '22 14:05 spuiuk

@spuiuk wrote:

https://tracker.ceph.com/issues/55510

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 ...

obnoxxx avatar Jul 18 '23 16:07 obnoxxx

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.

spuiuk avatar Jul 19 '23 08:07 spuiuk