DFS referrals only work for lower case or direct chdir

Bug #740062 reported by Sebastiaan Breedveld
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Binary package hint: linux-image-2.6.38-7-server

When a CIFS share has remote DFS links, the user is unable to access the mount properly. A short summary, where RemoteDir is a DFS to another server:

# mount.cifs //dfs.main.org/ test/ -o user=WORKGROUP/USER,noserverinode
# ls test/
RemoteDir
# ls test/RemoteDir/
ls: cannot open directory test/RemoteDir: Not a directory
# umount test

% And again, now with both ls on one line
# mount.cifs //dfs.main.org/ test/ -o user=WORKGROUP/USER,noserverinode
# ls test/; ls test/RemoteDir
RemoteDir
ls: reading directory test/RemoteDir/: Object is remote
# umount test

% Now chdir directly, without doing an ls (this is important)
# mount.cifs //dfs.main.org/ test/ -o user=WORKGROUP/USER,noserverinode
# cd test/RemoteDir
test/RemoteDir# ls
file1 file2
test/RemoteDir# cd ../../; umount test

% However, lower case works normally
# mount.cifs //dfs.main.org/ test/ -o user=WORKGROUP/USER,noserverinode
# cd test
test# ls
RemoteDir
test# ls remotedir
file1 file2
test# ls RemoteDir
ls: cannot open directory test/RemoteDir: Not a directory
# umount test

Note that unmounting is very important. After a mistake, (e.g. chdir does not work after ls), the share has to be remounted in order to chdir directly.

The problem is basically described here, except for report on lower case access:
http://<email address hidden>/msg01848.html

However, those patches are already in the 2.6.38 kernel (currently running linux-image-2.6.38-7-server (rev 37)), and the problem still persists.

On mounting, the kernel complains about:
CIFS VFS: Unexpected SMB signature
but no further complains on chdir/ls to the (DFS) mounts.

I am pretty sure this is a kernel problem, as downgrading to 2.6.32-21-server (Lucid kernel) solves all problems (that is, keyutils, time, credentials etc. are installed correctly).

System information:

1)
# lsb_release -rd
Description: Ubuntu Natty (development branch)
Release: 11.04

2)
# apt-cache policy linux-image-2.6.38-7-server
linux-image-2.6.38-7-server:
  Installed: 2.6.38-7.37
  Candidate: 2.6.38-7.37
  Version table:
 *** 2.6.38-7.37 0
        500 http://nl.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
        100 /var/lib/dpkg/status

3) I expect that DFS referrals work properly
4) They do not work properly
---
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.23.
AplayDevices: Error: [Errno 2] No such file or directory
Architecture: amd64
ArecordDevices: Error: [Errno 2] No such file or directory
AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/controlC0', '/dev/snd/hwC0D2', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/pcmC0D1p', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info: Error: [Errno 2] No such file or directory
Card0.Amixer.values: Error: [Errno 2] No such file or directory
DistroRelease: Ubuntu 11.04
InstallationMedia: Ubuntu-Server 11.04 "Natty Narwhal" - Alpha amd64 (20110201.2)
IwConfig:
 lo no wireless extensions.

 eth0 no wireless extensions.
MachineType: Dell Inc. OptiPlex 760
Package: linux (not installed)
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-7-server root=UUID=612c0087-c583-4155-ac06-f1492c4828a4 ro quiet
ProcVersionSignature: Ubuntu 2.6.38-7.39-server 2.6.38
RelatedPackageVersions:
 linux-restricted-modules-2.6.38-7-server N/A
 linux-backports-modules-2.6.38-7-server N/A
 linux-firmware 1.52
RfKill:

Tags: natty
Uname: Linux 2.6.38-7-server x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 08/17/2009
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A05
dmi.board.name: 0M859N
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.asset.tag: cl03-r756
dmi.chassis.type: 3
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvrA05:bd08/17/2009:svnDellInc.:pnOptiPlex760:pvr:rvnDellInc.:rn0M859N:rvrA00:cvnDellInc.:ct3:cvr:
dmi.product.name: OptiPlex 760
dmi.sys.vendor: Dell Inc.

Revision history for this message
jarle pedersen (jarle-pedersen) wrote :

Don't know if this helps, but here are some lines trying to keep to the established example:

#cd test/
#cd RemoteDir/
bash: cd: RemoteDir/: Not a directory

#stat RemoteDir/
stat: cannot stat ` RemoteDir/': Not a directory

#stat RemoteDir <----no slash this time
  File: `kontorkart'
  Size: 0 Blocks: 0 IO Block: 16384 directory
Device: 16h/22d Inode: 1043918 Links: 2
Access: (0711/drwx--x--x) Uid: ( 1000/ USER) Gid: ( 1000/ USER)
Access: 2011-06-08 15:31:21.189255968 +0200
Modify: 2011-06-08 15:31:21.189255968 +0200
Change: 2011-06-08 15:31:21.189255968 +0200

#cd RemoteDir
bash: cd: RemoteDir: Not a directory

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in dianosing the problem. From a terminal window please run:

apport-collect 740062

and then change the status of the bug back to 'New'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : AcpiTables.txt

apport information

tags: added: apport-collected natty
description: updated
Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : AlsaDevices.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : BootDmesg.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : Card0.Codecs.codec.2.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : Lspci.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : Lsusb.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : PciMultimedia.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : ProcCpuinfo_.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : ProcModules.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : UdevDb.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : UdevLog.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote : WifiSyslog.txt

apport information

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote :

Apport information submitted.

Changed in linux (Ubuntu):
status: Incomplete → New
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Gerlando F. (iurly) wrote :

I had the same problem.
In my understanding it is a matter of cached entries; that also explains why using a different case in the directory name causes the lookup to fail, so the directory get correctly mounted.
I provided a patch to the linux-cifs mailing list at:
http://article.gmane.org/gmane.linux.kernel.cifs/4520
The patch works for me.

Could someone please try it and provide feedback?
Thanks!

Revision history for this message
Sebastiaan Breedveld (s-breedveld) wrote :

Hi,

Your patch seems to solve this problem! I have tested it with kernel 3.0.0-12-server.

Thank you very much. Will this patch go upstream?

Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Thank you for providing a patch and making Ubuntu better.

Can you provide some information on the status of the patch with regards to getting it merged upstream? Has it been sent upstream, what sort of feedback has it received, is it getting applied to a subsystem maintainer's tree, etc?

Changed in linux (Ubuntu):
status: Confirmed → Triaged
tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.