FS#63999 - [cifs-utils] error "Stale file handle" when accessing a file on mounted CIFS share

Attached to Project: Arch Linux
Opened by chrpinedo (chrpinedo) - Thursday, 03 October 2019, 09:48 GMT
Last edited by freswa (frederik) - Friday, 21 February 2020, 21:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I initially sent the bug to the forums of Arch Linux and I found a workaround: https://bbs.archlinux.org/viewtopic.php?id=249503

We have an EMC VNX5800 storage device and I began having errors to mount CIFS shares of this storage device. The problem is with the version of the SMB protocol.

I can mount CIFS shares using any version but I can only access files with version 1.0. If I try to access files when I mounted the CIFS share with protocol version default, 2.0, 2.1 or 3.0 (higher are not supported by my storage device), I get the error "Stale file handle".


Additional info:
* package version(s): cif-utils 6.8-2, linux 5.3.1.arch1-1


Steps to reproduce:

Test1: if I mount with default version (linux host and storage devices negotiates the higher and common protocol version 3.0), I get the "Stale file handle" error:
$ sudo mount -t cifs //gorde.ehu.eus/home /mnt -o credentials=/etc/fstab.ldap.cred
$ mount | grep "/mnt"
//gorde.ehu.eus/home on /mnt type cifs (rw,relatime,vers=default,cache=strict,username=bcppizac,domain=ADM,uid=0,noforceuid,gid=0,noforcegid,addr=10.10.60.12,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1)
$ ls /mnt
2110031_MS_SQL_task_event_stat.sql '5.Pliego de prescripciones técnicas-comentarios_christian.docx' '5.Pliego de prescripciones técnicas.docx' cleanup_orphaned_data_MSSQL.sql.sql db_size.txt
$ cat /mnt/db_size.txt
cat: /mnt/db_size.txt: `handle' de fichero en desuso
$ LANG=C cat /mnt/db_size.txt
cat: /mnt/db_size.txt: Stale file handle

Test2: If I force to version 3.0, 2.1 or 2.0, I get the same error. For example, I attach the output by forcing to version 2.1:
$ sudo mount -t cifs //gorde.ehu.eus/home /mnt -o credentials=/etc/fstab.ldap.cred,vers=2.1
$ mount | grep "/mnt"
//gorde.ehu.eus/home on /mnt type cifs (rw,relatime,vers=2.1,cache=strict,username=bcppizac,domain=ADM,uid=0,noforceuid,gid=0,noforcegid,addr=10.10.60.12,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)
$ ls /mnt
2110031_MS_SQL_task_event_stat.sql '5.Pliego de prescripciones técnicas-comentarios_christian.docx' '5.Pliego de prescripciones técnicas.docx' cleanup_orphaned_data_MSSQL.sql.sql db_size.txt
$ LANG=C cat /mnt/db_size.txt
cat: /mnt/db_size.txt: Stale file handle

Test3: Only If I force to version 1.0, I can access the files:
$ sudo mount -t cifs //gorde.ehu.eus/home /mnt -o credentials=/etc/fstab.ldap.cred,vers=1.0
$ mount | grep "/mnt"
//gorde.ehu.eus/home on /mnt type cifs (rw,relatime,vers=1.0,cache=strict,username=bcppizac,domain=ADM,uid=0,noforceuid,gid=0,noforcegid,addr=10.10.60.12,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1)
$ ls /mnt
2110031_MS_SQL_task_event_stat.sql '5.Pliego de prescripciones técnicas-comentarios_christian.docx' '5.Pliego de prescripciones técnicas.docx' cleanup_orphaned_data_MSSQL.sql.sql db_size.txt
$ LANG=C cat /mnt/db_size.txt
SELECT SUM(p.used_page_count * 8)/1024 AS disk_size
FROM sys.dm_db_partition_stats p
JOIN sys.objects o
......


I am not sure if this bug is related to cifs-utils package, but I can assure:
- Windows hosts can mount CIFS shares of the storage device with 3.0 protocol version.
- Fedora (Linux) host can mount CIFS shares with 1.0,2.0,2.1,3.0 and 3.0.2 protocol versions. It uses cifs-utils 6.9 (archlinux provides 6.8) and linux kernel 5.2.17 (archlinux provides 5.3.1).


Although I can't assure it, the problem might be in the cifs-utils version. 6.9 version was released in April 5, 2019.
This task depends upon

Closed by  freswa (frederik)
Friday, 21 February 2020, 21:56 GMT
Reason for closing:  None
Additional comments about closing:  This seems pretty stalled to me. If it's still an issue, please fill a re-open request. Thank you :)

Loading...