#1055486 cifs-utils: Cannot copy files between 2 CIFS mounts on same client

Package:
cifs-utils
Source:
cifs-utils
Description:
Common Internet File System utilities
Submitter:
Nikola Belavic
Date:
2023-11-07 09:27:03 UTC
Severity:
normal
#1055486#5
Date:
2023-11-07 08:15:50 UTC
From:
To:
Dear Maintainer,

My machine (client) is "alberto" Debian 12, 6.1.0-13-amd64 (smbclient 2:4.17.12+dfsg-0+deb12u1, cifs-utils 2:7.0-2)

CIFS are mounted from /etc/fstab:
nicols@alberto:~$ cat /etc/fstab | grep betelgeuse | egrep "doc|temp"
//betelgeuse/doc                /mnt/betelgeuse/doc                     cifs    file_mode=0660,dir_mode=0770,uid=1000,gid=1000,forceuid,forcegid,username=nicols,password=XXXXXXXXXX
//betelgeuse/temp               /mnt/betelgeuse/temp                    cifs    file_mode=0660,dir_mode=0770,uid=1000,gid=1000,forceuid,forcegid,username=nicols,password=XXXXXXXXXX

nicols@alberto:~$ mount | grep betelgeuse  | egrep "doc|temp"
//betelgeuse/doc on /mnt/betelgeuse/doc type cifs (rw,relatime,vers=3.1.1,cache=strict,username=nicols,uid=1000,forceuid,gid=1000,forcegid,addr=10.33.33.16,file_mode=0660,dir_mode=0770,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1)
//betelgeuse/temp on /mnt/betelgeuse/temp type cifs (rw,relatime,vers=3.1.1,cache=strict,username=nicols,uid=1000,forceuid,gid=1000,forcegid,addr=10.33.33.16,file_mode=0660,dir_mode=0770,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1,closetimeo=1)

Create regular file:
    nicols@alberto:~$ echo "test" > file.txt
    nicols@alberto:~$ cat file.txt
    test

Create directories on cifs mounts:
    nicols@alberto:~$ mkdir /mnt/betelgeuse/temp/1
    nicols@alberto:~$ mkdir /mnt/betelgeuse/doc/1

Copy this file on both targets:
    nicols@alberto:~$ cp file.txt /mnt/betelgeuse/temp/1/
    nicols@alberto:~$ cp file.txt /mnt/betelgeuse/doc/1/

Verify it is there:
    nicols@alberto:~$ cat /mnt/betelgeuse/temp/1/file.txt
    test
    nicols@alberto:~$ cat /mnt/betelgeuse/doc/1/file.txt
    test

Directories look normal:
    nicols@alberto:~$ ls -al /mnt/betelgeuse/temp/1/
    total 2048
    drwxrwx--- 2 nicols nicols 0 stu   7 08:40 .
    drwxrwx--- 2 nicols nicols 0 stu   7 08:37 ..
    -rw-rw---- 1 nicols nicols 5 stu   7 08:37 file.txt

    nicols@alberto:~$ ls -al /mnt/betelgeuse/doc/1/
    total 1024
    drwxrwx--- 2 nicols nicols 0 stu   7 08:41 .
    drwxrwx--- 2 nicols nicols 0 stu   7 08:37 ..
    -rw-rw---- 1 nicols nicols 5 stu   7 08:37 file.txt

Create another file, copy to first mountpoint and verify:
    nicols@alberto:~$ echo "test test" > file2.txt
    nicols@alberto:~$ cp file2.txt /mnt/betelgeuse/doc/1/
    nicols@alberto:~$ cat /mnt/betelgeuse/doc/1/file2.txt
    test test

    nicols@alberto:~$ ls -al /mnt/betelgeuse/temp/1/
    total 2048
    drwxrwx--- 2 nicols nicols 0 stu   7 08:40 .
    drwxrwx--- 2 nicols nicols 0 stu   7 08:37 ..
    -rw-rw---- 1 nicols nicols 5 stu   7 08:40 file2.txt
    -rw-rw---- 1 nicols nicols 5 stu   7 08:37 file.txt

Copy directly from one CIFS to another:
    nicols@alberto:~$ cp /mnt/betelgeuse/temp/1/file2.txt /mnt/betelgeuse/doc/1/
    cp: error copying '/mnt/betelgeuse/temp/1/file2.txt' to '/mnt/betelgeuse/doc/1/file2.txt': No such file or directory

On destionation dir, empty file is created:
    nicols@alberto:~$ ls -al /mnt/betelgeuse/doc/1/
    total 1024
    drwxrwx--- 2 nicols nicols 0 stu   7 08:41 .
    drwxrwx--- 2 nicols nicols 0 stu   7 08:37 ..
    -rw-rw---- 1 nicols nicols 0 stu   7 08:41 file2.txt
    -rw-rw---- 1 nicols nicols 5 stu   7 08:37 file.txt
    nicols@alberto:~$ cat /mnt/betelgeuse/temp/1/file2.txt
    nicols@alberto:~$

Only way I can make this cp works is if i put "vers=1.0" in nounting options.
On another machine i have (Ubuntu 20.04.6 LTS, 5.4.0-152-generic, cifs-utils 2:6.9-1ubuntu0.2, smbclient 2:4.15.13+dfsg-0ubuntu0.20.04.2)
everything works as expected (with same mount options, vers=3.1.1)

I am sorry if this doesn't belong here, i am new to this bug reporting stuff :)


Regards

Nikola

#1055486#10
Date:
2023-11-07 09:23:10 UTC
From:
To:
fwiw, - cifs-utils is basically unmaintained in debian.