CIFS mount: Resource temporarily unavailable

Hi everyone,

I’ve been struggling recently to add CIFS support to my Boot2Qt Yocto build on an Apalis iMX8 (v6.5.6-lts.xml « toradex - yocto/boot2qt-manifest.git - Unnamed repository; edit this file 'description' to name the repository.).

Initially, I encountered issues following the documentation here: SMB support | Toradex Developer Center, as the options CONFIG_CIFS_SMB2 and CONFIG_CIFS_SMB311 are no longer supported. They have been replaced by CONFIG_CIFS, but this update is not reflected in the documentation (see: SMB Support - Kernel Modification ).

After building my image, I tried adding an SMB share in fstab with the following line:

 //server/share /mnt/smb/server_share cifs vers=3.0,file_mode=0777,dir_mode=0777,port=445,username=user,password=pass 0 0

Everything seems to work fine, and I can access my files at /mnt/smb/server_share. However, the problem arises when I run the df command, which outputs the following:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root             14988256   2393060  11812044  17% /
devtmpfs                410508         4    410504   0% /dev
tmpfs                   903756         0    903756   0% /dev/shm
tmpfs                   361504     10800    350704   3% /run
tmpfs                     4096         0      4096   0% /sys/fs/cgroup
tmpfs                   903756         4    903752   0% /tmp
tmpfs                   903756        40    903716   0% /var/volatile
/dev/mmcblk0p1           48380     13793     34588  29% /media/BOOT-mmcblk0p1
tmpfs                   180748         0    180748   0% /run/user/0
df: /mnt/smb/server_share: Resource temporarily unavailable

It seems that the mount point is not detected as a valid drive, which causes it to not be recognized in my Qt app, as QStorageInfo only lists valid drives. This was working correctly with an older Boot2Qt release (5.15.x).

It appears that there is a recent bug in the Linux 5.15 kernel related to CIFS (Bug #2060797 “df says Resource temporarily unavailable after ker... : Bugs : cifs-utils package : Ubuntu), and I’m unsure how to resolve this.

Do you know if this kernel bug will be patched in future Boot2Qt manifest releases, such as version 6.5.7?

Here is the relevant dmesg output when trying to mount the drive:

[ 6486.279150] CIFS: VFS: \\server\IPC$ validate protocol negotiate failed: -11

Any guidance would be greatly appreciated. Thank you!

Edit:

Also here the output provided by zcat /proc/config.gz |grep CIFS

root@b2qt-apalis-imx8:~# zcat /proc/config.gz  |grep CIFS
CONFIG_CIFS=y
CONFIG_CIFS_STATS2=y
CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y
# CONFIG_CIFS_UPCALL is not set
# CONFIG_CIFS_XATTR is not set
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_DEBUG_DUMP_KEYS is not set
# CONFIG_CIFS_DFS_UPCALL is not set
# CONFIG_CIFS_SWN_UPCALL is not set
# CONFIG_CIFS_ROOT is not set

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It seems like you’re encountering a known issue with CIFS in the Linux 5.15 kernel, which is affecting your ability to mount SMB shares correctly. This issue is causing the df command to report “Resource temporarily unavailable” for your CIFS mount point, which in turn affects your Qt application.

Here are a few steps you can take to troubleshoot and potentially resolve this issue:

  1. Kernel Configuration:
    Ensure that your kernel configuration includes the necessary CIFS options. Since CONFIG_CIFS_SMB2 and CONFIG_CIFS_SMB311 are no longer supported, make sure you have CONFIG_CIFS enabled in your kernel configuration.

  2. Mount Options:
    Double-check your mount options in /etc/fstab. Sometimes, tweaking the options can help. For example, you might try adding sec=ntlm or sec=ntlmssp to your mount options to see if it makes a difference:

//server/share /mnt/smb/server_share cifs vers=3.0,file_mode=0777,dir_mode=0777,port=445,username=user,password=pass,sec=ntlmssp 0 0


3. **Kernel Patch**:
Since this is a known bug, check if there are any patches available for the kernel version you are using. You can look at the upstream kernel mailing lists or repositories to see if a fix has been released.

4. **Update Boot2Qt**:
Keep an eye on updates to the Boot2Qt manifest. If version 6.5.7 or a later version is released, it might include a fix for this issue. You can also reach out to the maintainers of Boot2Qt to inquire about the status of this bug and any planned fixes.

5. **Workaround**:
As a temporary workaround, you might consider downgrading to an earlier kernel version where this issue was not present, if that is feasible for your project.

6. **dmesg Output**:
The `dmesg` output you provided indicates a protocol negotiation failure:

[ 6486.279150] CIFS: VFS: \server\IPC$ validate protocol negotiate failed: -11

This suggests that there might be an issue with the SMB protocol version being used. Ensure that the server supports the SMB version you are trying to use (in this case, SMB 3.0).

If none of these steps resolve the issue, you might need to wait for an official patch or update from the kernel maintainers or the Boot2Qt team. In the meantime, you can monitor the bug report you mentioned (Bug #2060797) for any updates or workarounds provided by the community.
         
Please, also check if these links can help you solve your problem:

https://bbs.archlinux.org/viewtopic.php?id=212128

https://community.toradex.com/tag/yocto?match_all_tags=true&page=7&tags%5B%5D=yocto

https://community.toradex.com/t/smb-support-kernel-modification/20421.

Hi @Romain.Donze

Thanks for pointing this out, we are going to review this documentation.

We don’t actually maintain Boot2Qt, this is maintained by The Qt Company, so I can’t give any answer for this.

Also,

the latest release version we have for apalis-imx8 boot2qt is 6.7.1

Hi Allan,

Thanks for your reply. Unfortunately, for now, we are staying on Qt 6.5 LTS, which is why we’re waiting for version 6.5.7, but it should be released by the end of the month. In the meantime, I’ll also reach out to The Qt Company regarding this issue.

Regards,
Romain