Access to samba 3.0.24-3.0.25 shares using CIFS is broken on 8.10

Bug #286828 reported by Eskild Hustvedt on 2008-10-21
186
This bug affects 21 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Wishlist
Unassigned
Intrepid
High
Tim Gardner
samba (Ubuntu)
Undecided
Unassigned
Intrepid
Undecided
Unassigned

Bug Description

Binary package hint: smbfs

System info:
smbfs:
  Installed: 2:3.2.3-1ubuntu3
  Candidate: 2:3.2.3-1ubuntu3
Description: Ubuntu 8.10
Release: 8.10
[0 zerodogg@firefly ~]$ uname -a
Linux firefly 2.6.27-7-generic #1 SMP Fri Oct 17 22:24:30 UTC 2008 x86_64 GNU/Linux

Expected results:
CIFS mounts keeps working after upgrade.

Results:
After upgrading from 8.04 to 8.10 (roughly one week ago, on the 23rd of Oct 08) using update-manager -d my CIFS mounts stopped working properly. I did not change any settings between them, and I have another machine on this network that is still running 8.04 and that doesn't have any problems.

They mount fine, and I can, with some effort, copy and read files from it (though I have to do it manually, as many programs will whine). As an example (here /mnt/diverse is my cifs mountpoint, mounted from a MyBook network drive):
[0 zerodogg@firefly ~]$ ls -l /mnt/diverse/test
ls: cannot access /mnt/diverse/test: No such file or directory
[2 zerodogg@firefly ~]$ touch /mnt/diverse/test
touch: setting times of `/mnt/diverse/test': Not a directory
[1 zerodogg@firefly ~]$ ls -l /mnt/diverse/test
-rwxr--r-- 1 zerodogg zerodogg 0 Oct 21 08:39 /mnt/diverse/test

[0 zerodogg@firefly ~]$ ls -l /mnt/diverse/test2
ls: cannot access /mnt/diverse/test2: No such file or directory
[2 zerodogg@firefly ~]$ touch test2
[0 zerodogg@firefly ~]$ mv test2 /mnt/diverse/
`test2' -> `/mnt/diverse/test2'
mv: preserving times for `/mnt/diverse/test2': Not a directory
mv: setting permissions for `/mnt/diverse/test2': Not a directory
removed `test2'
[0 zerodogg@firefly ~]$ chmod 644 /mnt/diverse/test2
chmod: changing permissions of `/mnt/diverse/test2': Not a directory
[0 zerodogg@firefly ~]$ rsync -avzh --progress --partial test3 /mnt/diverse/
sending incremental file list
test3
           0 100% 0.00kB/s 0:00:00 (xfer#1, to-check=0/1)
rsync: mkstemp "/mnt/diverse/.test3.mllG7b" failed: Not a directory (20)

sent 87 bytes received 31 bytes 236.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at main.c(1058) [sender=3.0.3]

The same commands, on the same mount on the 8.04 machine works perfectly fine. It also worked fine on this (8.10) machine before the upgrade.

The relevant fstab entry (I have tried with and without dir_mode,file_mode,nounix):
//zdmybook/DIVERSE /mnt/diverse cifs username=USERNAME,password=PASSWORD,uid=1000,gid=1000,dir_mode=0750,file_mode=0640,noauto,user,exec 0 0
[0 zerodogg@firefly ~]$ mount |grep div
//zdmybook/DIVERSE on /mnt/diverse type cifs (rw,mand,nosuid,nodev)

The fstab entry on the 8.04 box:
//zdmybook/DIVERSE /mnt/Diverse smbfs username=USER,password=PASSWORd,uid=1000,gid=1001,noauto,user,noatime 0 0

And as an example, this time from the 8.04:
[0 lisbeth@lisbeth ~]$ touch /mnt/diverse/123
[0 lisbeth@lisbeth ~]$ ls -l /mnt/diverse/123
-rwxr--r-- 1 lisbeth zerodogg 0 2008-10-21 08:53 /mnt/diverse/123
[0 lisbeth@lisbeth ~]$ mount|\grep div
//zdmybook/DIVERSE on /mnt/diverse type cifs (rw,mand,noexec,nosuid,nodev)
[0 lisbeth@lisbeth ~]$ LC_ALL=C apt-cache policy smbfs
smbfs:
  Installed: 3.0.28a-1ubuntu4.5
  Candidate: 3.0.28a-1ubuntu4.5
[0 lisbeth@lisbeth ~]$ lsb_release -rd
Description: Ubuntu 8.04.1
Release: 8.04
[0 lisbeth@lisbeth ~]$ uname -a
Linux lisbeth 2.6.24-21-generic #1 SMP Mon Aug 25 16:57:51 UTC 2008 x86_64 GNU/Linux

description: updated
Chuck Short (zulcss) wrote :

Is there anything in the error log about this?

Thanks
chuck

Changed in samba:
status: New → Incomplete
Eskild Hustvedt (zerodogg) wrote :

No, not that I can see. Nothing in dmesg, nothing in /var/log/syslog and nothing in /var/log/messages, and nothing in /var/log/samba/*.

[0 zerodogg@firefly ~]$ sudo egrep -i '(cifs|smb|samba)' /var/log/dmesg /var/log/messages /var/log/syslog|grep -v 'Modules linked in'
[1 zerodogg@firefly ~]$

Is there any way to make it more verbose so that it might log something useful?

Eskild Hustvedt (zerodogg) wrote :

I tried a fresh install of the RC and the same occurs there.

Keller Giacomarro (keller-g) wrote :

Getting the same 'not a directory' errors too.

FSTAB is unremarkable:

//10.x.xx.xx/DC\040Operations /media/app1/dcops cifs credentials=/etc/samba/genericuser 0 0

Creating new files with nano works. However, I can't edit the file once it's been created.

Please let me know what other information I can provide. Thanks!

Thierry Carrez (ttx) wrote :

Might be a CIFS issue, as apparently Eskild was running smbfs in 8.04 and that worked.

Could you try running "sudo echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled" before mounting the CIFS share and report if it changes something ?

Eskild Hustvedt (zerodogg) wrote :

That appears to have worked around it.

[0 root@firefly ~]# df|egrep -i '(cifs|smb)'
[1 root@firefly ~]# echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
[0 root@firefly ~]# mount /mnt/diverse
[0 root@firefly ~]# touch /mnt/diverse/test
[0 root@firefly ~]# exit
exit
[0 zerodogg@firefly ~]$ touch /mnt/diverse/test2
[0 zerodogg@firefly ~]$

Alexey Mentat (mentatxx) wrote :

I submit this problem - after upgrading 8.04->8.10, cifs mounted by fstab fails to write.

//10.1.1.1/sm /mnt/share cifs defaults,iocharset=utf8,codepage=cp866,rw,username=user,password=password,uid=user1 0 0

I have tried "sudo echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled" with no success.

Thierry Carrez (ttx) wrote :

Could other people experiencing this bug tell what type of network share they are trying to access (Samba server, network drive, NAS box brand, Windows Server, etc.) and if setting /proc/fs/cifs/LinuxExtensionsEnabled to 0 also solves the issue for them ?

Unfortunately, at the moment it appears that the /proc setting is the only way to request *not* to negociate the Unix extensions. It would be easier if we could specify it as a per-mount option.

Steve French talked about this option in the past, but apparently it never made it to CIFS:
http://lkml.org/lkml/2007/4/30/221
http://<email address hidden>/msg07737.html

Changed in samba:
status: Incomplete → New
Eskild Hustvedt (zerodogg) wrote :

Alexey, try:
echo 0 | sudo tee /proc/fs/cifs/LinuxExtensionsEnabled
and then remount your shares.

Redirection in sudo doesn't work like many expect it to.

Download full text (4.3 KiB)

"cat /proc/fs/cifs/Stats" to see if there were any reconnections and
"cat /proc/fs/cifs/DebugData" to list the version information that the
server reports for this mount

If you can save a wireshark (or tcpdump) trace of the failure that
would be ideal and would allow diagnosing the problem quickly. See
http://wiki.samba.org/index.php/Capture_Packets for more details on
how to do that.

On Fri, Oct 31, 2008 at 10:03 AM, Launchpad Bug Tracker
<email address hidden> wrote:
> You have been subscribed to a public bug by Dustin Kirkland (kirkland):
>
> Binary package hint: smbfs
>
> System info:
> smbfs:
> Installed: 2:3.2.3-1ubuntu3
> Candidate: 2:3.2.3-1ubuntu3
> Description: Ubuntu 8.10
> Release: 8.10
> [0 zerodogg@firefly ~]$ uname -a
> Linux firefly 2.6.27-7-generic #1 SMP Fri Oct 17 22:24:30 UTC 2008 x86_64 GNU/Linux
>
> Expected results:
> CIFS mounts keeps working after upgrade.
>
> Results:
> After upgrading from 8.04 to 8.10 (roughly one week ago, on the 23rd of Oct 08) using update-manager -d my CIFS mounts stopped working properly. I did not change any settings between them, and I have another machine on this network that is still running 8.04 and that doesn't have any problems.
>
> They mount fine, and I can, with some effort, copy and read files from it (though I have to do it manually, as many programs will whine). As an example (here /mnt/diverse is my cifs mountpoint, mounted from a MyBook network drive):
> [0 zerodogg@firefly ~]$ ls -l /mnt/diverse/test
> ls: cannot access /mnt/diverse/test: No such file or directory
> [2 zerodogg@firefly ~]$ touch /mnt/diverse/test
> touch: setting times of `/mnt/diverse/test': Not a directory
> [1 zerodogg@firefly ~]$ ls -l /mnt/diverse/test
> -rwxr--r-- 1 zerodogg zerodogg 0 Oct 21 08:39 /mnt/diverse/test
>
> [0 zerodogg@firefly ~]$ ls -l /mnt/diverse/test2
> ls: cannot access /mnt/diverse/test2: No such file or directory
> [2 zerodogg@firefly ~]$ touch test2
> [0 zerodogg@firefly ~]$ mv test2 /mnt/diverse/
> `test2' -> `/mnt/diverse/test2'
> mv: preserving times for `/mnt/diverse/test2': Not a directory
> mv: setting permissions for `/mnt/diverse/test2': Not a directory
> removed `test2'
> [0 zerodogg@firefly ~]$ chmod 644 /mnt/diverse/test2
> chmod: changing permissions of `/mnt/diverse/test2': Not a directory
> [0 zerodogg@firefly ~]$ rsync -avzh --progress --partial test3 /mnt/diverse/
> sending incremental file list
> test3
> 0 100% 0.00kB/s 0:00:00 (xfer#1, to-check=0/1)
> rsync: mkstemp "/mnt/diverse/.test3.mllG7b" failed: Not a directory (20)
>
> sent 87 bytes received 31 bytes 236.00 bytes/sec
> total size is 0 speedup is 0.00
> rsync error: some files could not be transferred (code 23) at main.c(1058) [sender=3.0.3]
>
> The same commands, on the same mount on the 8.04 machine works perfectly
> fine. It also worked fine on this (8.10) machine before the upgrade.
>
> The relevant fstab entry (I have tried with and without dir_mode,file_mode,nounix):
> //zdmybook/DIVERSE /mnt/diverse cifs username=USERNAME,password=PASSWORD,uid=1000,gid=1000,dir_mode=0750,file_mode=0640,noauto,user,exec 0 0
> [0 zerodogg@firefly ~]$ mount |grep div
> //zdmybook/DIVE...

Read more...

If disabling LinuxExtensions works as described above, there may be a problem with the support for the Unix/Linux/POSIX cifs protcol extensions on the device you are mounting (which is why it is important to note the version information of the server as it is reported over the network). Not that you can also disable Unix extensions on reasonably recent Linux kernels by specifying "nounix" as a command line option. Specifying "nounix" on mount forces the client to treat Samba servers (and others which would otherwise support the cifs unix extensions) like Windows (and just use the more limited set of protocol operations).

Steve French (smfrench) wrote :

Typo in the above (Not->Note)

"Note that you can also disable Unix extensions on reasonably recent Linux kernels by specifying "nounix" (as a cifs mount option)

Also note that you would normally not need to specify the default uid, gid, and mode on the mount if the server and clients have the same uids (as they could if they are both using winbind to logon users).

Jim Lehmer (jim-lehmer) wrote :

I am having the same problem after an upgrade to 8.10. Note that I changed the three entries in fstab to include the nounix option to no avail - here's a sample [specific names and addresses changed to protect the innocent]:

//xyzzy/Sources$ /usr/local/Sources cifs dir_mode=0777,file_mode=0644,iocharset=utf8,credentials=/root/.mountpw,rw,ip=10.0.0.162,domain=foo,netbiosname=bar,uid=snafu,gid=samba,nounix 0 0

However, when I use the same settings for a manual mount command, it works:

sudo mount -t cifs -o dir_mode=0777,file_mode=0644,iocharset=utf8,credentials=/root/.mountpw,rw,ip=10.0.0.162,domain=foo,netbiosname=bar,uid=snafu,gid=samba,nounix //xyzzy/Sources$ /usr/local/Sources

So, that leads me to wonder if it is a timing issue on boot and the mounts in fstab are trying to happen before samba client support is fully initialized?

Client info:

uname -a
Linux bar 2.6.27-7-generic #1 SMP Thu Oct 30 04:18:38 UTC 2008 i686 GNU/Linux

smbclient -V
Version 3.2.3

cat /etc/issue
Ubuntu 8.10 \n \l

Server info:

uname -a
Linux xyzzy 2.6.24-21-generic #1 SMP Tue Oct 21 23:09:30 UTC 2008 x86_64 GNU/Linux

smbd -i -V
Version 3.0.28a

cat /etc/issue
Ubuntu 8.04.1 \n \l

Unlike smbfs, Linux cifs client requires very little user space
intereraction unless you mount with Kerberos (sec=unix) or if the
server share is a DFS redirection to another server. The only user
space interaction other than that is translating host names to ip
address

On Sat, Nov 1, 2008 at 8:21 AM, Jim Lehmer <email address hidden> wrote:
> I am having the same problem after an upgrade to 8.10. Note that I
> changed the three entries in fstab to include the nounix option to no
> avail - here's a sample [specific names and addresses changed to protect
> the innocent]:
>
> //xyzzy/Sources$ /usr/local/Sources cifs
> dir_mode=0777,file_mode=0644,iocharset=utf8,credentials=/root/.mountpw,rw,ip=10.0.0.162,domain=foo,netbiosname=bar,uid=snafu,gid=samba,nounix
> 0 0
>
> However, when I use the same settings for a manual mount command, it
> works:
>
> sudo mount -t cifs -o
> dir_mode=0777,file_mode=0644,iocharset=utf8,credentials=/root/.mountpw,rw,ip=10.0.0.162,domain=foo,netbiosname=bar,uid=snafu,gid=samba,nounix
> //xyzzy/Sources$ /usr/local/Sources
>
> So, that leads me to wonder if it is a timing issue on boot and the
> mounts in fstab are trying to happen before samba client support is
> fully initialized?
>
> Client info:
>
> uname -a
> Linux bar 2.6.27-7-generic #1 SMP Thu Oct 30 04:18:38 UTC 2008 i686 GNU/Linux
>
> smbclient -V
> Version 3.2.3
>
> cat /etc/issue
> Ubuntu 8.10 \n \l
>
> Server info:
>
> uname -a
> Linux xyzzy 2.6.24-21-generic #1 SMP Tue Oct 21 23:09:30 UTC 2008 x86_64 GNU/Linux
>
> smbd -i -V
> Version 3.0.28a
>
> cat /etc/issue
> Ubuntu 8.04.1 \n \l
>
> --
> CIFS share broken after upgrade from 8.04 -> 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

I can also confirm this bug on Kubuntu 8.10.

Using the same mount options in 8.04 worked fine. In 8.10, files can be created, renamed, or deleted, but are NOT able to edit.

IE: Using Kate, I can open a file but can't save it. It is able to create its backup files.

Eclipse fails to save files as well on the mount.

Hopefully it gets fixed soon. The LinuxExtensions suggestion did not help the problem as I never used them on this mount.

I can confirm that older clients (8.04, 7.10) can read/write/save on the same mount with the same options just fine. Seems like a regression in Samba.

flanker (flanker-gmail) wrote :

Confirming Aron's recent report for Kubuntu 8.10. I'm running from the Intrepid Live CD right now, and experiencing the issue others have reported with being able to read/create, but not modify/overwrite files on the share. I've tried the nounix option (below) as well as the LinuxExtensionsEnabled = 0 option described above and they both give the same results. The server is running the packaged version of Samba3 for OpenWRT (more details below). This issue is of high importance to me (upgrade show-stopper), and I'd be happy to provide any additional information required---just let me know.

Mount parameters:
ubuntu@ubuntu:~$ tail -n 1 /etc/fstab
//myserver/media /home/ubuntu/sharetest cifs rw,uid=999,gid=999,credentials=/etc/credentialsfile,nounix 0 0

A little test demonstrating what works: create, append, remove, but not overwrite?
ubuntu@ubuntu:~$ sudo mount sharetest/
ubuntu@ubuntu:~$ cd sharetest/
ubuntu@ubuntu:~/sharetest$ echo happy > birthday
ubuntu@ubuntu:~/sharetest$ echo happier >> birthday
ubuntu@ubuntu:~/sharetest$ cat birthday
happy
happier
ubuntu@ubuntu:~/sharetest$ echo happiest > birthday
bash: birthday: Not a directory
ubuntu@ubuntu:~/sharetest$ cat birthday
happy
happier
ubuntu@ubuntu:~/sharetest$ rm birthday
ubuntu@ubuntu:~/sharetest$ ls birthday
ls: cannot access birthday: No such file or directory

Version info:
ubuntu@ubuntu:~/sharetest$ cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.200 Domain: MYDOMAIN Mounts: 1 OS: Unix
        NOS: Samba 3.0.24 Capability: 0x80f3fd
        SMB session status: 1 TCP status: 1
        Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

Shares:
1) \\myserver\media Uses: 2 Type: NTFS DevInfo: 0x0 Attributes: 0xb
PathComponentMax: 255 Status: 1 type: 0

ubuntu@ubuntu:~/sharetest$ smbclient -V && uname -a
Version 3.2.3
Linux ubuntu 2.6.27-7-generic #1 SMP Fri Oct 24 06:42:44 UTC 2008 i686 GNU/Linux

Aside: Has anyone tried downgrading to/pinning an older smbfs package? Maybe the ones reported as working from 8.04?

Latchezar Tzvetkoff (polizei) wrote :

Noticed that keeping the old kernels is generally a good idea...
After lots of headaches I've just rebooted and ran the 2.6.24-21.43 kernel and my work smb shares worked just fine...
Hope this get fixed ASAP, it's really a shame latest CIFS sources are that lame written/buggy/whatever...

Eric Krieger (grammatoncleric) wrote :

Not sure if this is related but I'm also having issues with CIFS. I can mount the storage just fine but sometimes if I try accessing the mounted CIFS share my system locks. Also when I am able to access the CIFS share in question I'm only able to see directories up to the letter "S" anything after is not listed even though it is there.

Probably not related - if you can get stack traces that would help
(e.g. "echo t > /proc/sysrq-trigger") at the time of a process hang
that would help to see what it is blocked on.

On the other question there are a pair of fixes to cifs in 2.6.27
which addressed a problem with directory searches to some servers.

On the original problem, I would like to see network traces
(wireshark, tcpdump or netmon) to isolate whether this is a server or
client bug

On Mon, Nov 3, 2008 at 10:55 AM, Eric Krieger
<email address hidden> wrote:
> Not sure if this is related but I'm also having issues with CIFS. I can
> mount the storage just fine but sometimes if I try accessing the mounted
> CIFS share my system locks. Also when I am able to access the CIFS
> share in question I'm only able to see directories up to the letter "S"
> anything after is not listed even though it is there.
>
> --
> CIFS share broken after upgrade from 8.04 -> 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

To make progress, we need data ...

Could someone please provide a wireshark (or tcpdump) trace of the problem. See

http://wiki.samba.org/index.php/Capture_Packets

for step-by-step description (it is really not hard ... but without this, we have no data)

Jim Lehmer (jim-lehmer) wrote :

I have tcpdump files ready to go but need to know if they will expose sensitive information, in which case I am loathe to just pump them up to here for the world to see, but would be happy to send them to someone on the project directly. I captured two files on the server:

1) The unsuccessful attempt from my client trying to connect using the entry in /etc/fstab.

2) The successful attempt from my client using an explicit mount command and the same mount options as specified in /etc/fstab.

Because it works using the mount command after boot and login, I am still thinking perhaps there is an out-of-order condition where the entries in fstab are trying to be mounted before network support is fully up? Again, the mounts via fstab were working on that client with Ubuntu 8.04 and stopped working after upgrading to 8.10 over the weekend.

The file save problem you mention is different than the automount
problem described earlier. In looking at the network trace of the
automount problem, I see that no traffic is sent on the network in the
failing case, which may simply be a configuration problem, or problem
locating mount.cifs during this early phase of boot.

On Sun, Nov 2, 2008 at 10:42 PM, Aron Schatz <email address hidden> wrote:
> I can also confirm this bug on Kubuntu 8.10.
>
> Using the same mount options in 8.04 worked fine. In 8.10, files can be
> created, renamed, or deleted, but are NOT able to edit.
>
> IE: Using Kate, I can open a file but can't save it. It is able to
> create its backup files.
>
> Eclipse fails to save files as well on the mount.
>
> Hopefully it gets fixed soon. The LinuxExtensions suggestion did not
> help the problem as I never used them on this mount.
>
> I can confirm that older clients (8.04, 7.10) can read/write/save on the
> same mount with the same options just fine. Seems like a regression in
> Samba.
>
> --
> CIFS share broken after upgrade from 8.04 -> 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

Here is an wireshark'd example of failed CIFS write

Alexey Mentat (mentatxx) wrote :

To clearify the problem:

After upgrading 8.04 --> 8.10, file writes via CIFS have been broken.
CIFS normally reads or creates files, but it fails to write into existing file.

To reproduce the problem: Try open in "midnight commander" or in "leafpad" any file via mounted cifs, make tiny changes and try to save. You'll got the write error !

(sorry for double post)

Alexey Mentat (mentatxx) on 2008-11-05
Changed in samba:
status: New → Confirmed
Eric Krieger (grammatoncleric) wrote :

capturing the any information post lockup will not be possible. the entire system freezes and requires a power cycle to recover.

The issue is defiantly a client issue. I've tested rolling my kernel back to 2.6.24-19 from 2.6.27-7 and everything works fine.

Could you point me to the pair of fixes to cifs in 2.6.27?

Thanks!

Sounds like a long shot but here are the fixes

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0752f1522a9120f731232919f7ad904e9e22b8ce

and

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=a364bc0b37f14ffd66c1f982af42990a9d77fa43

commit a364bc0b37f14ffd66c1f982af42990a9d77fa43
Author: Jeff Layton <email address hidden>
Date: Tue Oct 21 14:42:13 2008 +0000

    [CIFS] fix saving of resume key before CIFSFindNext

    We recently fixed the cifs readdir code so that it saves the resume key
    before calling CIFSFindNext. Unfortunately, this assumes that we have
    just done a CIFSFindFirst (or FindNext) and have resume info to save.
    This isn't necessarily the case. Fix the code to save resume info if we
    had to reinitiate the search, and after a FindNext.

    This fixes connectathon basic test6 against NetApp filers.

    Signed-off-by: Jeff Layton <email address hidden>
    CC: Stable <email address hidden>
    Signed-off-by: Steve French <email address hidden>

commit 0752f1522a9120f731232919f7ad904e9e22b8ce
Author: Steve French <email address hidden>
Date: Tue Oct 7 20:03:33 2008 +0000

    [CIFS] make sure we have the right resume info before calling CIFSFindNext

    When we do a seekdir() or equivalent, we usually end up doing a
    FindFirst call and then call FindNext until we get to the offset that we
    want. The problem is that when we call FindNext, the code usually
    doesn't have the proper info (mostly, the filename of the entry from the
    last search) to resume the search.

    Add a "last_entry" field to the cifs_search_info that points to the last
    entry in the search. We calculate this pointer by using the
    LastNameOffset field from the search parms that are returned. We then
    use that info to do a cifs_save_resume_key before we call CIFSFindNext.

    This patch allows CIFS to reliably pass the "telldir" connectathon test.

    Signed-off-by: Jeff Layton <email address hidden>
    CC: Stable <email address hidden>
    Signed-off-by: Steve French <email address hidden>

On Wed, Nov 5, 2008 at 1:53 PM, Eric Krieger <email address hidden> wrote:
> capturing the any information post lockup will not be possible. the
> entire system freezes and requires a power cycle to recover.
>
> The issue is defiantly a client issue. I've tested rolling my kernel
> back to 2.6.24-19 from 2.6.27-7 and everything works fine.
>
> Could you point me to the pair of fixes to cifs in 2.6.27?
>
> Thanks!
>
> --
> CIFS share broken after upgrade from 8.04 -> 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

I marked https://bugs.launchpad.net/ubuntu/+source/linux/+bug/279789 as a duplicate of this one. There's more information over there that may or may not help.

Christian

Aron Schatz (aronschatz) wrote :

Kernel 2.6.25-2 that's in the Intrepid repos also fixed the problem. I would use it, but the fglrx drivers don't work with that kernel for some reason.

This is a pretty major bug and should be quashed quickly.

Keller Giacomarro (keller-g) wrote :

Installing and rolling back to 2.6.25-2 did not fix the problem for me.

Also, this does not appear to affect all shares. I have shares to two different servers on my box -- one is fine, the other is not. Unfortunately, I don't have the rights to view the smb.conf on either of them.

Does anyone else have this?

Mathias Gug (mathiaz) wrote :

Although this seems a regression in the cifs client provided by the intrepid kernel (2.6.27), the version of the server the client connects to is also important.

Could you specify which version of the server you're connecting to? That information can be found in /proc/fs/cifs/DebugData.

Keller Giacomarro (keller-g) wrote :

Here are the (scrubbed) contents of /proc/fs/cifs/DebugData:

http://pastebin.com/f5796141d

Alexey Mentat (mentatxx) wrote :

Yet another dump:

Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: x.x.x.x Domain: ADMINO Mounts: 1 OS: Unix
 NOS: Samba 3.0.25a Capability: 0x80f3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

2) Name: y.y.y.y Domain: ADMINO Mounts: 1 OS: Unix
 NOS: Samba 3.0.25a Capability: 0x80f3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

3) Name: z.z.z.z Domain: ADMINO Mounts: 1 OS: Unix
 NOS: Samba 3.0.23d Capability: 0x80f3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

Shares:
1) \\x.x.x.x\share1 Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xb
PathComponentMax: 255 Status: 1 type: 0
2) \\y.y.y.y\share2 Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xb
PathComponentMax: 255 Status: 1 type: 0
3) \\z.z.z.z\share3 Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0xb
PathComponentMax: 255 Status: 1 type: 0

I can confirm that shares work with kernel 2.6.25 from the intrepid repos. I still had to mount the shares with the "nounix" option. See https://bugs.launchpad.net/ubuntu/+source/linux-ports/+bug/291487 if you need to compile kernel modules with the 2.6.25 kernel.

Downgrading the kernel and/or disabling UNIX extensions may not be an option for everybody. Any chance to get the patches mentioned in comment #26 into the repos?

For completeness, here's the info from /proc/fs/cifs/DebugData (with kernel 2.6.25 on the client side):

CIFS Version 1.52
Active VFS Requests: 0
Servers:
1) Name: x.x.x.x Domain: XXXXX Mounts: 2 OS: Unix
        NOS: Samba 3.0.24 Capability: 0x80f3fd
        SMB session status: 1 TCP status: 1
        Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

Shares:
1) \\servername\share Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x2b
PathComponentMax: 255 Status: 1 type: 0
2) ...

punknroll (punknroll) wrote :

I can also confirm this bug in ubuntu 8.10. with kernel 2.6.27-7.

Just use something like pico, gedit or eclipse to modify a file. It fails i guess using this save safe method of saving files, but I can edit files directly in the shell without problems. Unfortunately it is a fresh 8.10 install so i can't switch to an old kernel easily.

Steve French (smfrench) wrote :

I looked at the wireshark trace in post #25 (by Alexey) and I see what looks like a server bug in this old version of Samba (Samba 3.0.25). Note that Samba 3.2.4 is current, and Samba 3.0.32 contains various highly recommended fixes (Released in August Samba 3.0.32 "is the latest bug fix release for Samba 3.0 and is the version recommended for all production Samba servers running this release series")

In frame 8 the client opens a file (imagehost.pl) which succeeds

In frame 10 the client requests information on the same file which succeeds

In frame 14 the client tries to set the file size on the same file and the server (incorrectly) returns "STATUS_OBJECT_PATH_NOT_FOUND" ... obviously that can't be correct because the server just gave the client info on the same file in the previous request and there is no delete in between.

rylleman (rylleman) wrote :

I can also confirm this bug.

One thing that might be of interest is the error message I get from KeypassX;
"File could not be saved. The file could not be resized."

Can it be that there is nothing wrong with save itself but that the sizes of the files cannot be changed?

Is this bug persistent through later versions of Samba as well or would an upgrade fix it?

On Tue, Nov 18, 2008 at 9:55 AM, rylleman <email address hidden> wrote:
> I can also confirm this bug.
>
> One thing that might be of interest is the error message I get from KeypassX;
> "File could not be saved. The file could not be resized."
>
> Can it be that there is nothing wrong with save itself but that the
> sizes of the files cannot be changed?
The trace of the write failure in post 25 shows the server incorrectly
rejecting an attempt to set the file size, so it is plausible that
writes would work (also since writes are handle based not path based)
but that the setting of file size explicitly would fail.

> Is this bug persistent through later versions of Samba as well or would
> an upgrade fix it?
If the version of the server in your case is also Samba 3.0.25a (see
/proc/fs/cifs/DebugData on the client to display session information
including the server version) then I think it plausible that a server
upgrade would fix it.

--
Thanks,

Steve

aronschatz@ase1:/mnt$ cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: 192.168.1.105 Domain: ASE Mounts: 1 OS: Unix
        NOS: Samba 3.0.26a Capability: 0xf3fd
        SMB session status: 1 TCP status: 1
        Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

2) Name: 192.168.1.115 Domain: ASE Mounts: 1 OS: Unix
        NOS: Samba 3.0.24 Capability: 0xf3fd
        SMB session status: 1 TCP status: 1
        Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

Shares:
1) \\192.168.1.105\pub Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x2b
PathComponentMax: 255 Status: 1 type: 0
2) \\192.168.1.115\web Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x2b
PathComponentMax: 255 Status: 1 type: 0

I added the mount to 192.168.1.105 for testing and it seems that with Samba version 3.0.24, the writes don't work correctly while the 3.0.26a mount does work correctly.

3.0.24 is from Feisty and 3.0.26a is from Gutsy. Even though the Feisty mount was working before hand, I get something happened to fix a problem that stopped it from working?

Can a working Samba version be back ported to Feisty? Or do we need to upgrade to Gutsy (at least)?

Upgrading Samba on my FreeBSD server from version 3.0.24 to the current one from ports (3.0.32) did indeed fix the issue for me as well.

punknroll (punknroll) wrote :

Hi all, an upgrade to Gutsy and samba 3.0.26a solved my problems! Thanx Steve for your hint.

Alexey Mentat (mentatxx) wrote :

Thanx a lot, Steve !

Upgrading Samba server upto 3.0.32 have solved the problem

But i think small "errata" notification should be written on this trouble for future users.

Many thanks, Steve, for helping us debug this one !
I updated the title to reflect the types of servers affected.

Aron: Feisty is no longer supported so you should at least upgrade to Gutsy.

Steve French (smfrench) wrote :

Since the Samba servers 3.0.24 through 3.0.25a which exhibited this problem may have had problems with parsing a "DFS path" (in this case for a path based call to set the file server), could someone check if the write problems go away if the mount is done with the "nodfs" mount option (would require fairly recent cifs client, perhaps even 2.6.27 kernel, to use that mount option) - that changes how the client sends paths from "\\server\share\dir\file" to "\dir\file" and may work around the problem if the server bug was caused by the processing of dfs paths

# uname -r
2.6.27-7-generic
# mount -t cifs -o rw,user=xxx,password=xxx,nodfs //dns-323/Shared /mnt/dummy
# tail -1 /var/log/messages
Nov 20 08:34:24 mgjv kernel: [ 1670.862969] CIFS: Unknown mount option nodfs

Looks like that needs an ever newer kernel.

I am having this problem with a DNS-323 NAS, so I don't easily have the option of upgrading the Samba version on that, and would like to see some resolution to this bug. happy to provide more information.

BTW, the nounix option changes behaviour, but does not fix it. If wanted, I can provide test and wiretap dumps later today.

I've attached a tar file with two Wireshark dumps, as I couldn't work out how to
attach two files to a comment here directly.

If more information is required, please let me know.

Server: DNS-323, samba 3.0.24
Client: Ubuntu 8.10, kernel 2.6.27-7-generic

with standard settings:
-----------------------

Wireshark dump file: cifs.no-options.filtered.dump

mgjv# cat /proc/fs/cifs/LinuxExtensionsEnabled
1
mgjv# mount -t cifs -o rw,user=dummy,password=testme //dns-323/Shared /mnt/dummy
mgjv# ls -l /mnt/dummy/Temp/testfile
ls: cannot access /mnt/dummy/Temp/testfile: No such file or directory
mgjv# touch /mnt/dummy/Temp/testfile
touch: setting times of `/mnt/dummy/Temp/testfile': Not a directory
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwxrwx 1 507 502 0 2008-11-20 10:15 /mnt/dummy/Temp/testfile
mgjv# echo "" > /mnt/dummy/Temp/testfile
zsh: not a directory: /mnt/dummy/Temp/testfile
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwxrwx 1 507 502 0 2008-11-20 10:15 /mnt/dummy/Temp/testfile
mgjv# rm /mnt/dummy/Temp/testfile
mgjv# echo "" > /mnt/dummy/Temp/testfile
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwxrwx 1 507 502 1 2008-11-20 10:16 /mnt/dummy/Temp/testfile
mgjv# rm /mnt/dummy/Temp/testfile
mgjv# umount /mnt/dummy

with nounix mount option
------------------------

Wireshark dump file: cifs.nounix.filtered.dump

The mode when the file has been created doesn't look right.
The behaviour is the same when /proc/fs/cifs/LinuxExtensionsEnabled is set to 0.

mgjv# cat /proc/fs/cifs/LinuxExtensionsEnabled
1
mgjv# mount -t cifs -o rw,user=dummy,password=testme,nounix //dns-323/Shared /mnt/dummy
mgjv# ls -l /mnt/dummy/Temp/testfile
ls: cannot access /mnt/dummy/Temp/testfile: No such file or directory
mgjv# touch /mnt/dummy/Temp/testfile
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwSrwx 1 root root 0 2008-11-20 10:22 /mnt/dummy/Temp/testfile
mgjv# echo "" > /mnt/dummy/Temp/testfile
zsh: not a directory: /mnt/dummy/Temp/testfile
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwSrwx 1 root root 0 2008-11-20 10:22 /mnt/dummy/Temp/testfile
mgjv# rm /mnt/dummy/Temp/testfile
mgjv# echo "" > /mnt/dummy/Temp/testfile
mgjv# ls -l /mnt/dummy/Temp/testfile
-rwxrwSrwx 1 root root 1 2008-11-20 10:18 /mnt/dummy/Temp/testfile
mgjv# rm /mnt/dummy/Temp/testfile
mgjv# umount /mnt/dummy

The "nodfs" option was added by this patch:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c1b861539c15491593625920058e06452cd3747

which went in right after 2.6.27 came out so will be in 2.6.28. The
patch is small and could be added to this 2.6.27 distro kernel easily
enough. Apparently most distros did not ship the two problematic
Samba versions on their server, or have done a mandatory upgrade,
which is why we don't see this problem (server parsing of dfs paths)
more often.

On Wed, Nov 19, 2008 at 3:39 PM, Martien Verbruggen
<email address hidden> wrote:
> # uname -r
> 2.6.27-7-generic
> # mount -t cifs -o rw,user=xxx,password=xxx,nodfs //dns-323/Shared /mnt/dummy
> # tail -1 /var/log/messages
> Nov 20 08:34:24 mgjv kernel: [ 1670.862969] CIFS: Unknown mount option nodfs
>
> Looks like that needs an ever newer kernel.
>
> I am having this problem with a DNS-323 NAS, so I don't easily have the
> option of upgrading the Samba version on that, and would like to see
> some resolution to this bug. happy to provide more information.
>
> BTW, the nounix option changes behaviour, but does not fix it. If
> wanted, I can provide test and wiretap dumps later today.
>
> --
> Access to samba<3.0.26 shares using CIFS is broken on 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

Confirming dapper samba server (3.0.22-based) is unaffected.
The "nodfs" workaround (if it works) would indeed be good to have for those stuck with non-upgradeable NAS boxes.

Thierry Carrez (ttx) wrote :

Also confirming that using the "nodfs" option on a patched kernel allows a successful workaround for affected Samba servers. Reassigning to "linux", Chuck has already been pushing the patch to the kernel team.

Changed in linux:
importance: Undecided → Wishlist
Changed in samba:
status: Confirmed → Invalid
Tim Gardner (timg-tpi) wrote :

SRU Justification

Impact: see bug description
Patch Description: add a nodfs mount options that forces a share to be used with non DFS paths, even if the server claims, that it supports it.

Patch: http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-intrepid.git;a=commit;h=e5cefa9f15f8952579d697d54f27f5e82d0b2113

Test case: see bug description

Changed in linux:
assignee: nobody → timg-tpi
importance: Undecided → High
milestone: none → intrepid-updates
status: New → Fix Committed
Changed in samba:
status: New → Invalid
Changed in linux:
status: New → Invalid

Another workaround: set "msdfs root = no" on affected shares or in the [global] section of smb.conf. If you don't use DFS at all you can also disable it completely with "host msdfs = no".

This also made UNIX extensions finally work. Note that I had to remount all shares to get things working. I don't use DFS, so I can't tell what effect mixing DFS shares with non-DFS shares will have.

This approach has the advantage that you don't need any changes on the client side, even when the nodfs option will be available - useful if you have a lot of clients to fix.

MichaelE (michael-eitelwein) wrote :

Can confirm the bug on 8.10 with a samba server on Debian etch. Disabling DFS solves it.

Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: x.y.z.a Domain: EITELWEIN Mounts: 7 OS: Unix
 NOS: Samba 3.0.24 Capability: 0x80e3fd
 SMB session status: 1 TCP status: 1
 Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
MIDs:

Shares:
1) \\x.y.z\michael Uses: 1 Type: NTFS DevInfo: 0x0 Attributes: 0x2b
PathComponentMax: 255 Status: 1 type: 0

A warning about the "msdfs root = no" workaround: This broke some of the drive mappings on Windows clients. Shares that are mapped via "NET USE" (like in a logon script) don't seem to be affected - a name is a name - but connections manually set up through the GUI seem to store some additional information and had to be reconnected manually. So much about network transparency *sigh*

I took the occasion and set up a logon script which does all the mappings. This repaired some of the broken mappings automatically, but some mappings still had to be disconnected manually. There seem to be some other factors involved. Very weird.

I still think disabling an unused and broken feature is a good idea anyway, but do some thorough testing and be prepared for having to fix some issues manually.

I just installed the new kernel (2.6.27-9-generic x86_64), but this fix doesn't seem to have made it in there yet. nodfs seems to be an unknown mount option for cifs.

Any indication as to which update will have this fix?

Thanks,

mipper (mipper) wrote :

Forgive my ignorance here, but I can see that there appears to have been a fix committed for this bug, but I can't see when or how it's going to be released. This is an absolute show stopper bug as far as I can see, so how and when can I get a fix for it?

truxntrax (truxntrax) wrote :

Waiting for a fix here too. Confusingly this issue has ony affected one of my pc's after the ibex upgrade. My laptop still see my nas box and popcorn hour but my desktop I have to manually nount drives after boot (sudo mount -a).

Happy to help with any investigations if more information is required.

Just to summarize again:
1) A few versions of Samba server had a bug parsing DFS paths (fixed
in Samba server 3.0.26). You can see which version of server you have
mounted to by doing "cat /proc/fs/cifs/Debug
Data " on the client). When the Linux CIFS client added support for
DFS last year, those few (relatively old) versions of Samba servers
(when configured for DFS) exhibited problems with certain path based
calls (setting the file size was one) which can break some common
applications.

2) Although disabling the cifs unix extensions (mount option "nounix")
may help in some cases, the best solution is to upgrade the Samba
server to any of the more recent versions of the server. If that is
not possible, disabling DFS support (see comment 50) in the server is
another possibility (on future kernels, 2.6.28 includes this e.g., you
will be able to specify "nodfs" as a mount option on the client to
workaround the problems on these two versions of Samba).

On Sat, Nov 29, 2008 at 11:30 AM, truxntrax <email address hidden> wrote:
> Waiting for a fix here too. Confusingly this issue has ony affected one
> of my pc's after the ibex upgrade. My laptop still see my nas box and
> popcorn hour but my desktop I have to manually nount drives after boot
> (sudo mount -a).
>
> Happy to help with any investigations if more information is required.

--
Thanks,

Steve

mipper (mipper) wrote :

So to summarize your summary,

if you don't have any control over the server - which was running fine with the 8.04 client - you're stuffed! I don't understand how a bug in the server is causing something that works under 8.04 to stop working under 8.10, and I really can't understand why fixing this doesn't seem to be an urgent issue. It wasn't the introduction of anything new on the server side that caused this problem to arise, it was an update to the client - or am I still missing something?

Regards,

mipper

> Just to summarize again:
> 1) A few versions of Samba server had a bug parsing DFS paths (fixed
> in Samba server 3.0.26). You can see which version of server you have
> mounted to by doing "cat /proc/fs/cifs/Debug
> Data " on the client). When the Linux CIFS client added support for
> DFS last year, those few (relatively old) versions of Samba servers
> (when configured for DFS) exhibited problems with certain path based
> calls (setting the file size was one) which can break some common
> applications.

> 2) Although disabling the cifs unix extensions (mount option "nounix")
> may help in some cases, the best solution is to upgrade the Samba
> server to any of the more recent versions of the server. If that is
> not possible, disabling DFS support (see comment 50) in the server is
> another possibility (on future kernels, 2.6.28 includes this e.g., you
> will be able to specify "nodfs" as a mount option on the client to
> workaround the problems on these two versions of Samba).

Thierry Carrez (ttx) wrote :

mipper:
This is a bug about servers claiming they support something that they don't. If client stuff makes use of that "something" and trust servers to properly implement what they claim they do, it doesn't work. It happens that the client stuff in Intrepid takes advantage of those advanced features, while the client stuff in hardy didn't.

The fix:
Fix your server by upgrading to a non-affected version.

However, we understand that the server might not be easily upgradable. For example it might be a closed NAS box with a sucky warranty. For those few stuck with buggy servers, we provide the following workarounds:

- If you have access to the samba configuration on the server, you can add "msdfs root = no" in smb.conf
- If you have no access whatsoever to the server, a new kernel providing a "nodfs" client-side mount option is being published. You will be able to use that option to turn off the advanced features in the client stuff for Intrepid.

Jim Lehmer (jim-lehmer) wrote :

To follow up on mipper's point, here's what I don't understand:

1) My server is Ubuntu 8.04, currently patched.

2) I upgraded my workstation from 8.04 to 8.10 and lose the ability to have my CIFS shares on the server mounted automatically at boot time as they were right up until I upgraded.

3) So, if it's the server's fault, why hasn't Ubuntu pushed out the appropriate patches to 8.04?

The common thread in all of this is Ubuntu, and therefore IMHO Ubuntu should FIX IT.

mipper (mipper) wrote :

Thanks for the clarification, Thierry. I am, alas, in the last position, so
am very interested in knowing when the new kernel will be published. I
can't find any target dates on this bug report and it's the lack of any
visibility on when the fix might be released that's so frustrating. How
does one find out when the release will be.

Regards,

mipper

2008/12/1 Thierry Carrez <email address hidden>

> mipper:
> This is a bug about servers claiming they support something that they
> don't. If client stuff makes use of that "something" and trust servers to
> properly implement what they claim they do, it doesn't work. It happens that
> the client stuff in Intrepid takes advantage of those advanced features,
> while the client stuff in hardy didn't.
>
> The fix:
> Fix your server by upgrading to a non-affected version.
>
> However, we understand that the server might not be easily upgradable.
> For example it might be a closed NAS box with a sucky warranty. For
> those few stuck with buggy servers, we provide the following
> workarounds:
>
> - If you have access to the samba configuration on the server, you can add
> "msdfs root = no" in smb.conf
> - If you have no access whatsoever to the server, a new kernel providing a
> "nodfs" client-side mount option is being published. You will be able to use
> that option to turn off the advanced features in the client stuff for
> Intrepid.
>
> --
> Access to samba 3.0.24-3.0.25 shares using CIFS is broken on 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Thierry Carrez (ttx) wrote :

mipper:
According to the kernel team, the patch is still in the pipeline. It /should/ appear in the next kernel published in intrepid-proposed.

Thank you to all who have taken the time to investigate! The DNS323 suffers from this server side DFS bug but it is possible to work around it!!!

Connect to the DNS using the web GUI and goto tools->system.

In this page you can save the configuration to your workstation.
After saving edit the file and add the following line under ;[ global ]
msdfs root = no

Save the file and now back in the GUI for the DNS323, upload the config you edited. The device will reset but the settings will be passed on to the samba server and all will be well in wellsville.

Thanks again!

Keller Giacomarro (keller-g) wrote :

I can confirm that upgrading the server-side to Samba 3.2.5 fixed the issue.

mipper (mipper) wrote :

@Skokie
Thanks very much for this tip. That's sorted me out nicely.

I've contacted D-Link regarding a firmware fix for this issue and received the following reply:

"A firmware is being develop, we don't have an ETA or upgrades that it will have, i invite you to go to forums.dlink.com, you can post and get updated information by product managers on new releases."

So a genuine fix is on the way, just no idea when. Looking at the frequency with which firmware upgrades have been release in the past I'd hope it's not too long before it arrives.

Many thanks to all who responded.

Steve Langasek (vorlon) wrote :

Accepted into intrepid-proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Thierry Carrez (ttx) wrote :

Could those affected by the bug test that mounting with the "nodfs" mount option on the current kernel in intrepid-proposed works around the issue ? Thanks.

Vide (vide80) wrote :

I was affected by this problem as well and I can confirm that using 2.6.27-11 and the "nodfs" mount option the problem is solved. I tested this on x86 and x86_64.

I can add that with the -9 kernel the "/proc/fs/cifs/LinuxExtensionsEnabled" workarond wasn't working anymore (with previous revisions it worked smoothly, but it was a workaround)

mipper (mipper) wrote :

I can confirm the fix too. Doesn't work without nodfs, does with.

After adding "nodfs" to my kernel at boot time did NOT change anything.
My MS Windows shares that use to mount automatically under 8.04 still do
not mount automatically after adding that option. Yet, after boot, I can
issue "sudo mount /shares/windows_f" and the share is mounted without
incident or error messages.

I performed an upgrade from 8.04, not a new, clean install.

Relevant line from syslog:
Dec 23 06:27:43 tom-nb kernel: [ 0.000000] Kernel command line:
root=UUID=9810c849-9967-45c4-9a82-415e2ddcb81c ro quiet splash nodfs

Output from uname -a:
Linux tom-nb 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686
GNU/Linux

Relevant lines from fstab:
//192.168.4.10/NetworkShare /shares/windows_f cifs
auto,rw,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0

//192.168.4.10/NetworkShare2 /shares/windows_o cifs
auto,rw,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0

Thierry Carrez wrote:
> Could those affected by the bug test that mounting with the "nodfs"
> mount option on the current kernel in intrepid-proposed works around the
> issue ? Thanks.
>

--

http://www.thetwaros.com
Registered Linux User #466934
http://counter.li.org/

Thierry Carrez (ttx) wrote :

Tom: "nodfs" is not a kernel boot parameter. It's a CIFS mount option, you should add it to your /etc/fstab (only) for mounts targeting the affected servers.

Jim Lehmer (jim-lehmer) wrote :

It did not work for me as a mount parameter.

To recap:

1) When both the client and server were Ubuntu 8.04 the boot-time CIFS mounts on the client "just worked". See my post above for fstab entries.

2) Upgraded client to 8.10, boot-time CIFS mounts stopped working, although can still get to the shares using the Places|Connect to Server... menu. Not as convenient and not as accessible by scripts however.

3) Upgraded server to 8.10 as well, boot-time CIFS mounts still don't work, even with the nodfs and nounix mount options.

Vide (vide80) wrote :

Tom: as Thierry clearly stated you have to use a recent kernel from the intrepid-proposed repository. The 2.6.27-9 you're using is still broken

Tom (ttwaro) wrote :

Thank you for the clarification, Thierry. I changed my fstab entry like
this:
//192.168.4.10/NetworkShare /shares/windows_f cifs
nodfs,auto,rw,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0

and rebooted. Still does NOT work. However, when manually running "sudo
mount /shares/windows_f" I now receive this error:
[ 823.764453] CIFS: Unknown mount option nodfs

 From what I have read I believe I need an update for my current version
of kernel (2.6.27-9-generic). Guess I'll have to wait until then to try
this.

Thierry Carrez wrote:
> Tom: "nodfs" is not a kernel boot parameter. It's a CIFS mount option,
> you should add it to your /etc/fstab (only) for mounts targeting the
> affected servers.
>

--

http://www.thetwaros.com
Registered Linux User #466934
http://counter.li.org/

On Tue, Dec 23, 2008 at 5:54 AM, Tom <email address hidden> wrote:
> After adding "nodfs" to my kernel at boot time did NOT change anything.
> My MS Windows shares that use to mount automatically under 8.04 still do
> not mount automatically after adding that option. Yet, after boot, I can
> issue "sudo mount /shares/windows_f" and the share is mounted without
> incident or error messages.
>
> I performed an upgrade from 8.04, not a new, clean install.
>
> Relevant line from syslog:
> Dec 23 06:27:43 tom-nb kernel: [ 0.000000] Kernel command line:
> root=UUID=9810c849-9967-45c4-9a82-415e2ddcb81c ro quiet splash nodfs
>
>
> Output from uname -a:
> Linux tom-nb 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686
> GNU/Linux
>
> Relevant lines from fstab:
> //192.168.4.10/NetworkShare /shares/windows_f cifs
> auto,rw,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0
>
> //192.168.4.10/NetworkShare2 /shares/windows_o cifs
> auto,rw,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0

I doubt that that problem was related to the problem with write which
was originally reported. Since cifs has very few dependencies on
userspace (the upcall for Kerberos ie sec=krb5, and the upcall for dfs
hostname resolution), it is not obvious why automount should differ
from mount after boot, unless there is a problem getting to
/sbin/mount.cifs

--
Thanks,

Steve

Jim Lehmer (jim-lehmer) wrote :

Steve:

I still wonder if it's a timing issue, i.e., if there was a subtle change in services start order or else in the time it is taking networking to completely come up? That could explain why (a) it worked in 8.04 but not in 8.10, and (b) after the boot is complete and issuing a mount command with the exact same parameters as the fstab entry it just works.

I have just upgraded to kernel "2.6.27-11-generic" and running "nodfs"
as a mount option as previously posted. I no longer get the error
message but the mount still does not happen automatically during/after
boot. I still need to mount the share manually. This worked every time
in 8.04 and 7.10.

Vide wrote:
> Tom: as Thierry clearly stated you have to use a recent kernel from the
> intrepid-proposed repository. The 2.6.27-9 you're using is still broken
>

--

http://www.thetwaros.com
Registered Linux User #466934
http://counter.li.org/

Vide (vide80) wrote :

Tom, but your mount at bootime issue it's a completely different topic (do you put the "_netdev" label in the fstab options? it's mandatory for network shares).

Tom (ttwaro) wrote :

I tried this but it didn't work. Isn't this for nfs fstype only? I have
CIFS. I could be misunderstanding something, though.

Vide wrote:
> Tom, but your mount at bootime issue it's a completely different topic
> (do you put the "_netdev" label in the fstab options? it's mandatory for
> network shares).
>

--

http://www.thetwaros.com
Registered Linux User #466934
http://counter.li.org/

Tom (ttwaro) wrote :

One more thing, this is on my laptop connecting wirelessly to the
shares. This worked perfectly EVERY time under 8.04 but never has worked
under 8.10. I'm sure it is a timing issue (waiting for the wireless
connection) but it had to do this under 8.04 too.

To reiterate:

* Window XP share
* Ubuntu 8.10 laptop wirelessly connected to the network
* Connected to share under 8.04 and 7.10 automatically
* Won't connect to share under 8.10 automatically
* Can manually mount share "sudo mount /shares/windows_f"
* fstab entry: //192.168.4.10/NetworkShare /shares/windows_f cifs
nodfs,auto,rw,_netdev,credentials=/root/.creds,uid=ttwaro,gid=ttwaro 0 0
/
* Kernel: 2.6.27-11-generic

Thanks for your responses.

Vide wrote:
> Tom, but your mount at bootime issue it's a completely different topic
> (do you put the "_netdev" label in the fstab options? it's mandatory for
> network shares).
>

--

http://www.thetwaros.com
Registered Linux User #466934
http://counter.li.org/

Thierry Carrez (ttx) wrote :

Jim/Tom:
As Steve said, this is very likely to be a separate issue (my guess would be the network-manager changes in 8.10 that expose wireless connections very late in the boot/login process), could one of you please file a separate bug ? I don't want to delay publication of this fix because of disconnected problems.

As far as this bug is concerned, if booting 2.6.27-11 and (manually) mounting the CIFS share with nodfs allows the mount to succeed, then it's ok. So far vide, mipper and Tom confirmed that fix...

I agree that a distinct problem should be opened for the automount
issue. The two problems are distinct and the problem with automount
is likely due to changes in network driver initialization or
packaging.

On Wed, Dec 24, 2008 at 2:43 AM, Thierry Carrez
<email address hidden> wrote:
> Jim/Tom:
> As Steve said, this is very likely to be a separate issue (my guess would be the network-manager changes in 8.10 that expose wireless connections very late in the boot/login process), could one of you please file a separate bug ? I don't want to delay publication of this fix because of disconnected problems.
>
> As far as this bug is concerned, if booting 2.6.27-11 and (manually)
> mounting the CIFS share with nodfs allows the mount to succeed, then
> it's ok. So far vide, mipper and Tom confirmed that fix...
>
> --
> Access to samba 3.0.24-3.0.25 shares using CIFS is broken on 8.10
> https://bugs.launchpad.net/bugs/286828
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Thanks,

Steve

simonm (simon-mullis) wrote :

Symptom: When mounting remote CIFS shares from my Apple Time Capsule (either by /etc/fstab or mount command) I would only see around 150 of the 5000 directories in my "Media" folder.

Also, redirection from stdout to a file would work when the file was created, but appending would not work.

so:
% pwd
/remote/mount/
% echo "1 2 3" >> test_file
% cat test_file
1 2 3
% echo "4 5 6" >> test_file
% cat test_file
1 2 3
cat: test_file: Input/output error

I updated to 2.6.27-11-generic (via Intrepid-proposed) and added the "nodfs" option to my /etc/fstab entry.

Now, I see all directories as expected.

However, stdout redirection to a file still seems to be misbehaving...
% uname -a
Linux freya 2.6.27-11-generic #1 SMP Thu Jan 8 08:38:33 UTC 2009 i686 GNU/Linux
% pwd
/remote/mount/
% echo "1 2 3" >> test_file
% cat test_file
1 2 3
% echo "4 5 6" >> test_file
% cat test_file
1 2 3
cat: test_file: Input/output error

Additional info:
% mount | egrep -e '(cifs|smb)'
//192.168.0.2/storage on /media/storage type cifs (rw,mand)

% grep cifs /etc/fstab
//192.168.0.2/storage /media/storage cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0664,dir_mode=0775,uid=simonm,gid=audio,nodfs 0 0

So, still having some issues with appending to files. Creating / deleting seems fine.

Thierry Carrez (ttx) wrote :

Could the other people affected do the same redirection test simonm did ? Just to check if it's a general problem or a specific (Time Capsule ?) one.

Vide (vide80) wrote :

Thierry, I've just tried what simonm said and no errors here, it all seems fine (mounting a Debian 3.0.24-6etch10 samba server from Ubuntu 8.10 with 2.6.27-11 kernel and the nodfs option)

% echo "1 2 3" >> test_file
% cat test_file
1 2 3
% echo "4 5 6" >> test_file
% cat test_file
1 2 3
4 5 6

Thierry Carrez (ttx) wrote :

Cool, thanks Vide !
simonm: please file a separate bug for your appending issue, since it looks like a separate (additional) issue.

Thierry Carrez (ttx) wrote :

Marking verification-done following Vide/mipper/Tom reporting success.

mbentley (mbentley) wrote :

i found that when i used the "msdfs root = no" option on my samba 3.0.24 server running debian etch, it caused my windows clients that have shares mapped to network drives to stop working and i couldn't access them by \\<server>\<share>. in order to get it working on my windows xp computers, i had to restart them and remount the network drives for it to work but it indeed does work. i know that this really isn't the intended purpose of this bug report, but at first i thought that including "msdfs root = no" broke my shares on my windows boxes.

thank you for this workaround as i do not plan on upgrading from the standard debian etch on my server anytime in the near future.

I think it's related to the Samba version in use on Time Capsule:

# cat /proc/fs/cifs/DebugData
Display Internal CIFS Data Structures for Debugging
---------------------------------------------------
CIFS Version 1.54
Active VFS Requests: 0
Servers:
1) Name: 192.168.0.2 Domain: SM-HOME Uses: 1 OS: Apple Base Station
    NOS: CIFS 4.30 Capability: 0x1c
    SMB session status: 1 TCP status: 1
    Local Users To Server: 1 SecMode: 0x3 Req On Wire: 0
    Shares:
    1) \\192.168.0.2\storage Mounts: 1 Type: FAT32 DevInfo: 0x0 Attributes:
0x3
PathComponentMax: 255 Status: 0x1 type: 0

    MIDs:

# cat /proc/fs/cifs/LinuxExtensionsEnabled
1

Also, I have hundreds of log entries like this in /var/log/kern.log

Jan 18 17:17:02 freya kernel: [ 4069.510271] CIFS VFS: Write2 ret -9, wrote
0

The CIFS mount from Time Capsule is the only CIFS mount I am using.

I'll get some CIFS packet captures of a Hardy install and an Intrepid
install and create a new ticket. (Although I think this is the same issue as
a number of the people who commented above have had.)

I hope this helps.

Thanks

SM

--
Simon Mullis

Launchpad Janitor (janitor) wrote :
Download full text (16.6 KiB)

This bug was fixed in the package linux - 2.6.27-11.25

---------------
linux (2.6.27-11.25) intrepid-proposed; urgency=low

  [ Jeff Layton ]

  * SAUCE: cifs: make sure we allocate enough storage for socket address
    - LP: #318565

linux (2.6.27-11.24) intrepid-proposed; urgency=low

  [ Stefan Bader ]

  * Revert "SAUCE: don't use buggy _BCL/_BCM/_BQC for backlight control"
    - LP: #311716
  * SAUCE: acpi: Hack to enable video and vendor backlight implementations
    - LP: #311716
  * SAUCE: Force vendor backlight control on ThinkPad T61
    - LP: #311716

  [ Upstream Kernel Changes ]

  * Revert "thinkpad_acpi: fingers off backlight if video.ko is serving
    this functionality"
    - LP: #311716

linux (2.6.27-11.23) intrepid-proposed; urgency=low

  [ Andy Whitcroft ]

  * SAUCE: don't use buggy _BCL/_BCM/_BQC for backlight control
    - LP: #311716, #314119

  [ Jim Lieb ]

  * SAUCE: atl2: add tx bytes statistic
    - LP: #268622

  [ Upstream Kernel Changes ]

  * i915: Save/restore MCHBAR_RENDER_STANDBY on GM965/GM45
    - LP: #276943

linux (2.6.27-11.22) intrepid-proposed; urgency=low

  [ Andy Whitcroft ]

  * Revert "synchronise our linux-libc-dev with the kernel userspace
    headers". It was causing regressions.
    - LP: #300803

  [ Brian Rogers ]

  * SAUCE: Add support for MSI TV@nywhere Plus remote
    - LP: #281647

  [ Tim Gardner ]

  * SAUCE: Dell laptop digital mic does not work, PCI 1028:0271
    - LP: #309508

  [ Upstream Kernel Changes ]

  * Revert "sched_clock: prevent scd->clock from moving backwards"
  * AMD IOMMU: enable device isolation per default
  * bonding: fix miimon failure counter
  * x86 Fix VMI crash on boot in 2.6.28-rc8
  * libata: fix Seagate NCQ+FLUSH blacklist
  * e1000e: fix double release of mutex
  * can: Fix CAN_(EFF|RTR)_FLAG handling in can_filter
  * can: omit received RTR frames for single ID filter lists
  * iwlwifi: clean key table in iwl_clear_stations_table function
  * net: eliminate warning from NETIF_F_UFO on bridge
  * unicode table for cp437
  * console ASCII glyph 1:1 mapping
  * key: fix setkey(8) policy set breakage
  * firewire: fw-ohci: fix IOMMU resource exhaustion
  * ieee1394: add quirk fix for Freecom HDD
  * SUNRPC: Fix a performance regression in the RPC authentication code
  * b1isa: fix b1isa_exit() to really remove registered capi controllers
  * macfb: Do not overflow fb_fix_screeninfo.id
  * setup_per_zone_pages_min(): take zone->lock instead of zone->lru_lock
  * xilinx_hwicap: remove improper wording in license statement
  * Linux 2.6.27.10 except for "iwlagn: fix RX skb alignment". Besides causing
    an ABI bump it only applies to machines using > 4K page size (such as PowerPC).
    Pick this one up on the next ABI bumping upload.
    - LP: #309731

linux (2.6.27-11.21) intrepid-proposed; urgency=low

  [ Andy Whitcroft ]

  * synchronise our linux-libc-dev with the kernel userspace headers
    - LP: #300803

  [ Jim Lieb ]

  * SAUCE: [PATCH 1/1] USB: Unusual devs patch for Nokia 5610
    - LP: #287701

  [ Michael Krufky ]

  * sms1xxx: use new firmware for Hauppauge WinTV MiniStick
    - LP: #299671
  * sms1xxx: add autodetection support for Hauppa...

Changed in linux:
status: Fix Committed → Fix Released
Scott Carpenter (scottc) wrote :

I'm running Samba on a Linksys/Cisco NSLU2 (the slug!) and started having this problem after upgrading my client from 8.04 to 8.10. Just wanted to report that the "nodfs" mount option took care of the problem for me. Thanks everyone for all the work figuring this out!

Andreas (andreas-waldherr) wrote :

"nodfs" does the trick for me too :-) Thanks a lot!!!!
Was not able do to file synchronization (using unison or synkron) - got a lot off errors...

I am using as Client:
ubuntu desktop 8.10 Intrepid with kernel 2.6.27-11 (default) - fstab command
"//500Gig/public /media/500Gig cifs guest,nodfs,rw,iocharset=utf8,uid=1000 0 0"

as Server:
A Philips NAS (SPD8020CC/10, Firmware Version: 1.2.9.47)

komputes (komputes) wrote :

I can confirm having the same problem with an Apple Time Capsule. I do not know how to get it to display files or prompt for authentication. I only get a blank window with 0 items.

ii samba 2:3.3.2-1ubuntu3 SMB/CIFS file, print, and login server for Unix

Distributor ID: Ubuntu
Description: Ubuntu 9.04
Release: 9.04
Codename: jaunty

Andrew McRae (ajmcrae) wrote :

As usual in the Linux world we see a lot of dodging and ducking and passing the buck and pretending that something other than Ubuntu is the problem. The bug ticket has been marked as "Invalid", and yet the problem is clearly still here and has not been fixed.

If you try to use smbmount (ie- mount.cifs) in Jaunty it still fails when trying to save files.

Notice the solutions offered by the people who said it was fixed. They had to change their configuration or upgrade their SAMBA server to get it to work! That's a kludge to their system to work around a bug in Ubuntu. No-one should have to change any parameters to smbmount or fstab or upgrade the SAMBA server to get their SMB shares mounted properly when the same commands worked fine in Hardy.

My (former) Hardy and (present) Jaunty configuration uses this Sessions startup command:
  smbmount '\\192.168.1.2\public' /home/andrew/naspublic -o guest

This worked fine in Hardy Heron, but now in Jaunty neither GEdit nor OpenOffice nor Audacious can save changes to files opened from the mountpoint.
The firmware on my QNAP NAS has not changed, and the command I use to mount the share has not changed since Hardy, but after the "upgrade" to Jaunty none of my apps can save back to the share. The idea that an upstream kernel patch in 2.6.27-11.25 has fixed this is absurd : I'm booting 2.6.28-14 and my machine still has the problem.

So it's not the kernel, and it's not the user application, and it's not the user-supplied commands, it's a bug in one of the Ubuntu distribution packages. Clearly a bug has been written between Hardy and Intrepid and is still here in Jaunty.

Downgrading the kernel is not an option since then GDM no longer starts up and without graphics OOo can't run.

There's three short-term workarounds, none of which are nice:
A) Uninstall Jaunty and go back to Hardy, or
B) Switch to using Windows XP, or
C) Copy to local drive, edit, copy back.

Option B actually is the easiest since I dual boot Windows anyway and could install Microsoft Windows version of OOo if i had to. At least in Windows when you mount the share as a drive letter it just plain works.

Would prefer it if Ubuntu programmers could just fix the bug.
Get those smbfs guys inspecting the code they changed between Hardy and Intrepid and they will find the defect. It has to be there, that's only logical.

Vide (vide80) wrote :

Andrew: I'm no Ubuntu dev but I've been suffering this bug when first appeared and the bug is clearly and without any doubt on the Samba server side. With Samba server I don't mean upstream Samba code but the Samba server present for example in Debian Etch (and other OS/devices too, like your NAS).
The bug is not in the client side, so no Ubuntu fault here. Why Hardy was working and Intrepid/Jaunty aren't without the nodfs option? Simply because THE KERNEL HAS BEEN UPDATED. Ubuntu even backported new changes (the nodfs option) which could be used as workaround for people experiencing the bug in older versions

So, before ranting, go read all the previous comments.
Long story short: in your smbmount command pass the nodfs option by mean of the -o switch

smbmount '\\192.168.1.2\public' /home/andrew/naspublic -o guest,nodfs

should work with Ubuntu >= Intrepid

Andrew McRae (ajmcrae) wrote :

So this confirms it's a new defect in Ubuntu's Samba library.

Final rant begins!
I reiterate, Windows has no problem at all with reading and writing shares on my NAS, and neither did Hardy.
A bug is a matter of actual interoperability and user expectation. One day, somebody changed something in the SMB library used by Ubuntu and it broke compatibility with servers that other miscellaneous clients can still use just fine. They caused a bug.

Contrary to your allegation, I had read the previous comments and had seen the nodfs workaround but did not find it acceptable from a design point of view. Again, a lot of hand waving and misdirection to try to ignore that somebody coded Samba however they felt like that day regardless of the impact it had on the real user population.

It's like some people love Ubuntu so much that they will defend the indefensible - even in an Ubuntu bug tracker forum with 93 posts and three duplicate reports! :-)

What do all the unaffected clients have in common? They don't use the new Samba. If this buggy version of Samba had not been added to Ubuntu we would not have seen a problem.
That's the hilarious part of the bug: The Samba project only broke compatibility with *themselves*.

Here's what it boils down to. The only way you could argue this was not due to a defect in Ubuntu is to suggest there is some specification somewhere which says that the new version of Samba is the one true "correct" version and therefore the CIFS share in my NAS should *never* have worked properly at all when mounted by the smbmount module in Hardy, and by the client in prior Unbuntu versions, AND by the equivalent subsystem in Windows XP, AND by my WM6 PocketPC phone. Even if that were true, in practice what is the value of such knowledge when the cure is worse than the disease?
Samba is not the centre of the universe. We are people who do not expect O/S "upgrades" to break compatibility with perfectly functional file servers. It should not have been fixed it if it wasn't broken. A peer-to-peer protocol library should not have been changed in a way that required all clients and servers to be updated simultaneously.

My problem isn't with you personally, Vide, since you've been quite helpful actually.
The systemic problem is the "fractured community" nature of Linux development, which routinely lacks care, cohesion, and practicality. Yeah, I shouldn't expect much for free.

Thank you for taking the time to spell out what I consider to be a workaround. I guess under the circumstances I'll have to take whatever remedy I can get.
I'll give it a try.

Steve French (smfrench) wrote :

Simplifying:
1) older smbfs/smbmount had a "bug": they didn't support DFS (which Windows clients do, and Linux cifs client does) which is a critical feature of the protocol in multiple server environments
2) Windows does not support Unix Extensions

Samba server introduced a bug (long since fixed) which affects clients which support BOTH

Asking the kernel cifs client to always disable DFS support (ie without a mount option) to work around a bug in one server version would make things even worse because that would hurt accessing all of the servers that have working DFS support.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers