Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#28 Mounting Samba shares works no longer

1.0
closed
None
2012-12-26
2012-12-15
Ettore Atalan
No

Smb4K version: 1.0.4 (compiled from source)
OS: Kubuntu 12.10 x64 (Kernel 3.5.0)

Hi,

mounting Samba shares works no longer after several months of daily use.

The first problem appeared yesterday. Out of nowhere, it was no longer possible to write on a specific samba share while writing on other shares was still possible.

The next problem appeared today. After several restarts of notebook and NAS and checking permissions to solve the problem with the lost write permission no samba share works any longer. Smb4K lags on startup and hangs when trying to mount any samba share.

Ettore Atalan

Discussion

  • What changed? Did you update the system prior to the failure?

     
  • Ettore Atalan
    Ettore Atalan
    2012-12-16

    Some minor updates have been done, but nothing SMB-specific.

     
  • Ettore Atalan
    Ettore Atalan
    2012-12-20

    Does Smb4K write a log file?

     
    • No, it doesn't.

      I tried to reproduce your problem on my Kubuntu 12.10 machine, but without success. Still, I think it is not Smb4K that causes this strange behavior. Does mounting from the shell work? To check this, please run

      $ sudo mount.cifs //SERVER/SHARE /mount/point -o user=USER,ip=IP
      

      in a terminal. If that also fails, there is a different problem. If it works, please post it here.

       
    • assigned_to: Alexander Reinholdt
     
  • Ettore Atalan
    Ettore Atalan
    2012-12-22

    Mounting works in Terminal. The interesting is that all mounted shares appear in Smb4K as "mounted share" and they can be unmounted via Smb4K.

    EDIT: Trying to get write permissions (rw) on the shares doesn't work.

     
    Last edit: Ettore Atalan 2012-12-22
  • Ettore Atalan
    Ettore Atalan
    2012-12-24

    I'm stuck. No logfile, no idea where's the problem.

    Merry Christmas
    Ettore Atalan

     
  • PhobosK
    PhobosK
    2012-12-25

    I can confirm this bug on Gentoo amd64 too:
    smb4k v1.0.4 compiled from source
    samba v3.6.10
    kernel v3.6.6

    Sadly I cannot tell what exactly was updated, so smb4k stopped working.

    The bug is that when trying to mount any share in smb4k, it creates the path where the share will be mounted and then freezes, leaving the only way out using the 'kill' command.

    smb4k's "Open Mount dialog" doesn't work too (freezes too).
    "Preview" share works ok.
    Using manual mount in terminal with the parameters listed above works too.

    No logs in system log, nor anywhere. In syslog the only thing found that looks like a problem is:
    de.berlios.smb4k.mounthelper: QDBusConnection: system D-Bus connection created before QCoreApplication. Application may misbehave.

    What I have noticed is that the system dbus service - "de.berlios.smb4k.mounthelper", starts the /usr/lib64/kde4/libexec/mounthelper, and after 10 seconds they both disappear.
    If the /usr/lib64/kde4/libexec/mounthelper is started manually as root, it quits after 10 secs too.
    If /usr/lib64/kde4/libexec/mounthelper is started manually as root and in the next 10 seconds an attempt to mount any share in the smb4k is made, nothing happens... The behaviour is freezing the same way.

    If any share is mounted manually in a terminal it can be unmounted in smb4k without problems.

     
    Last edit: PhobosK 2012-12-25
  • Have you tried to recompile Smb4K? Does mounting also fail then?

     
  • PhobosK
    PhobosK
    2012-12-25

    Yep I've recompiled every single piece of software that could be connected to the problem... like polkit, samba, smb4k, kdelibs, dbus ... but nothing helps... No problems in the process of compiling too...

     
  • PhobosK
    PhobosK
    2012-12-25

    It seems there is a problem with smb4k when it tries recursively to chmod the perms according to settings when mounting the share... It tries to chmod even /home/USER, /home and even /... Though they are already 0755...

    Here is an strace:


    31779 stat("/sbin/mount.cifs", {st_mode=S_IFREG|0755, st_size=40472, ...}) = 0
    31779 lstat("/sbin/mount.cifs", {st_mode=S_IFREG|0755, st_size=40472, ...}) = 0
    31779 access("/sbin/mount.cifs", X_OK) = 0
    31779 stat("/home/MYUSER/mnt/smb", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 lstat("/home/MYUSER/mnt/smb", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 access("/home/MYUSER/mnt/smb", R_OK) = 0
    31779 access("/home/MYUSER/mnt/smb", W_OK) = 0
    31779 access("/home/MYUSER/mnt/smb", X_OK) = 0
    31779 stat("/home", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 stat("/home/MYUSER", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
    31779 stat("/home/MYUSER/mnt", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 stat("/home/MYUSER/mnt/smb", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 stat("/home/MYUSER/mnt/smb/WRT610N", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 stat("/home/MYUSER/mnt/smb/WRT610N/Shared", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
    31779 chmod("/home/MYUSER/mnt/smb/WRT610N/Shared", 0755) = 0
    31779 chmod("/home/MYUSER/mnt/smb/WRT610N/", 0755) = 0
    31779 chmod("/home/MYUSER/mnt/smb/", 0755) = 0
    31779 chmod("/home/MYUSER/mnt/", 0755) = 0
    31779 chmod("/home/MYUSER/", 0755) = 0
    31779 chmod("/home/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)
    31779 chmod("/", 0755) = -1 EPERM (Operation not permitted)


    And so on and so on with the -1 EPERM

     
  • Ettore Atalan
    Ettore Atalan
    2012-12-25

    Exactly the same problem on my machine.

     
    Attachments
  • PhobosK
    PhobosK
    2012-12-25

    The problem is that the user may have entered the mount dir without a trailing slash, so when compared parentDirectory may differ to u (line 189 in core/smb4kmounter_p.cpp) by a trailing slash... So a patch is needed. I am applying it... Have tested it and smb4k works again.

    And while the patch is applied upstream, one may change his mount dir in the preferences of smb4k adding a trailing slash to the dir....

     
    Attachments
  • PhobosK
    PhobosK
    2012-12-25

    I have reported this to Gentoo portage too, so a fix for Gentoo be released. Here is the bug report

     
    • Thank you for sharing the patch. In my investigations I reached the same conclusion, but haven't had the time to come up with a fix. So your work is much appreciated.

       
  • Ettore Atalan
    Ettore Atalan
    2012-12-25

    I have just applied your patch for v1.0.4 and Smb4K works again. No more mounting problems and write permissions work too. Great work!

    This patch should be applied in upstream.

    Many Thanks and Merry Christmas!
    Ettore Atalan

     
    • PhobosK
      PhobosK
      2012-12-25

      Thanks and you are welcome :)

      Well I can try committing it to playground/network/smb4k, but I am afraid Alexander may not like that :)
      So I'll leave it to him...

       
      • I just committed the fix to playground and to the 1.0 branch. Thanks again for your work and Merry Christmas!

        Alexander

         
    • milestone: New tickets --> 1.0
     
    • status: open --> pending
     
    • status: pending --> closed