Score:1

Mounting cifs drive with snapshot option gives: "cifs: Bad value for 'snapshot'"

fr flag

I have File share in Azure and I want to mount one of its snapshots. I am using following command:

sudo /bin/mount -t cifs //storageAccountName.file.core.windows.net/fileShareName /home/userName/mount -o vers=3.0,credentials=/home/userName/cred,dir_mode=0444,file_mode=0444,serverino,snapshot=132888855100000000

and it fails with

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

I can get slightly more info with sudo tail -f /var/log/kern.log

Feb  9 18:16:58 VmName kernel: [ 3963.812792] cifs: Bad value for 'snapshot'

If I don't use the snapshot option then everythig works as expected (but then I have current File share not snapshot)

sudo /bin/mount -t cifs //storageAccountName.file.core.windows.net/fileShareName /home/userName/mount -o vers=3.0,credentials=/home/userName/cred,dir_mode=0444,file_mode=0444,serverino

I use Ubuntu 20.04* in Azure, the strange thing is that in Ubuntu 18.04** it works just fine! Unfortunately I am forced to use 20.04.

*Ubuntu 20.04:

>hostnamectl
         Icon name: computer-vm
           Chassis: vm
    Virtualization: microsoft
  Operating System: Ubuntu 20.04.3 LTS
            Kernel: Linux 5.11.0-1028-azure
      Architecture: x86-64

>apt list --installed | grep cifs
cifs-utils/focal-updates,now 2:6.9-1ubuntu0.1 amd64 [installed]

**Ubuntu 18.04:

>hostnamectl
         Icon name: computer-vm
           Chassis: vm
    Virtualization: microsoft
  Operating System: Ubuntu 18.04.6 LTS
            Kernel: Linux 5.4.0-1067-azure
      Architecture: x86-64

>apt list --installed | grep cifs
cifs-utils/bionic-updates,now 2:6.8-1ubuntu1.1 amd64 [installed]

I was even able to update cifs-utils in Ubuntu 18.04 to version 6.9 (the same as in 20.04) and it still worked just fine so I don't think cifs-utils is the problem.

Any help appreciated.

Score:0
fr flag

It is Linux kernel regression (introduced in v5.11). They added some additional checks (in commit "24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f"). One of them is checking that snapshot value is 32 unsigned integer. Trouble is this value is supposed to be 64 unsigned integer. Hence the wrong check resulted in "bad value" error message and fail of mount.

For details see their bugtracker: https://bugzilla.kernel.org/show_bug.cgi?id=215593

robot40q avatar
fr flag
Will accept when the issue in kernel is confirmed.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.