[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    plasma hang on unrechable devices
From:       Thomas Kallenberg <thomas () no-more-secrets ! ch>
Date:       2009-10-20 9:53:37
Message-ID: 1256032417.11890.50.camel () warbird-IV
[Download RAW message or body]

Hi all!

After several months I went crazy about this bug here...

https://bugs.kde.org/show_bug.cgi?id=194196
https://bugzilla.redhat.com/show_bug.cgi?id=491211
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530558

and i made some investigations why this happens. 
As you may all know if you want to access a directory which has been
mounted remotely and there is no connection to the server with the
attached volume, the request hangs.

As I discovered the bug is not in plasma. It's in Solid. And it's not
actually a bug. It rather seems that someone forgot about the fact with
the hanging request above while doing the solid design.

So the actual "bug" lies in the halfstabhandling. halfstabhandling
generates a cache with all the fstab entries in there and tries
periodically to renew this cache. while building this cache it tries to
resolve a possible symlink (if it really is one) on all the mountpoints
and the devices given in fstab. And there it goes. Since the mounted
volume is not reachable anymore, it will hang!

The fact that the whole plasma hangs, comes from kickoff. But I don't
see any reason why kickoff needs information about fstab since it
doesn't display anything about it. So removing kickoff or using lancelot
will help here.
But lunching kde or using dolphin (with unreachable device) is the other
thing. Both hangs long time.
In dolphin it's even worse. It hangs every time you hovering with the
mouse about an icon and every time you do this solid retrieves
information about fstab, which is in my opinion somehow stupid.

So I had this bug on a laptop with smbfs and nfs and I made a little
hack which "solves" the problem for me. 

It would be nice to hear some voices about this issue or even better get
some help so solve this.

cheers
	thomas

["solidhack.patch" (solidhack.patch)]

Index: halfstabhandling.cpp
===================================================================
--- halfstabhandling.cpp	(revision 1037939)
+++ halfstabhandling.cpp	(working copy)
@@ -56,6 +56,14 @@
     return resolved;
 }
 
+bool _k_isNetworkFileSystem(const QString &fstype)
+{	
+	if (fstype == "nfs" || fstype == "nfs4" || fstype == "smbfs" || fstype == "cifs")
+		return true;
+	return false;
+}
+
+
 void _k_updateMountPointsCache()
 {
     static bool firstCall = true;
@@ -81,10 +89,12 @@
 
     struct mntent *fe;
     while ((fe = getmntent(fstab)) != 0) {
+	if (!isNetworkFileSystem(fe->mnt_type)) {
         const QString device = _k_resolveSymLink(QFile::decodeName(fe->mnt_fsname));
         const QString mountpoint = _k_resolveSymLink(QFile::decodeName(fe->mnt_dir));
 
         globalMountPointsCache->insert(device, mountpoint);
+	}
     }
 
     endmntent(fstab);
@@ -117,11 +127,13 @@
             continue;
         }
 #endif
+	//prevent accessing a blocking directory
+	if (!_k_isNetworkFileSystem(items.at(2))) {
+        	const QString device = _k_resolveSymLink(items.at(0));
+	        const QString mountpoint = _k_resolveSymLink(items.at(1));
 
-        const QString device = _k_resolveSymLink(items.at(0));
-        const QString mountpoint = _k_resolveSymLink(items.at(1));
-
-        globalMountPointsCache->insert(device, mountpoint);
+        	globalMountPointsCache->insert(device, mountpoint);
+	}
    }
 
    fstab.close();


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic