HAL stats nfs and autofs mounts, preventing autofs timeouts from working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hal (Ubuntu) |
Fix Released
|
Low
|
Martin Pitt |
Bug Description
(Cribbed from http://
Tested and works perfectly.
Update of /cvs/dist/
In directory cvs.devel.
Modified Files:
hal.spec
Added Files:
hal-0.
Log Message:
- Add patch that makes hald not stat nfs and autofs mounts
hal-0.5.
blockdev.c | 15 +++++++++++++++
1 files changed, 15 insertions(+)
--- NEW FILE hal-0.5.
--- hal-0.5.
+++ hal-0.5.
@@ -205,6 +205,21 @@
while ((mnte = getmntent_r (f, &mnt, buf, sizeof(buf))) != NULL) {
struct stat statbuf;
+ /* If this is a nfs mount or autofs
+ * (fstype == 'nfs' || fstype == 'autofs')
+ * ignore the mount. Reason:
+ * 1. we don't list nfs devices in HAL
+ * 2. more problematic: stat on mountpoints with
+ * 'stale nfs handle' never come
+ * back and block complete HAL and all applications
+ * using HAL fail.
+ * 3. autofs and HAL butt heads causing drives to never
+ * be unmounted
+ */
+ if (strcmp(
+ strcmp(
+ continue;
+
/* check the underlying device of the mount point */
if (stat (mnt.mnt_dir, &statbuf) != 0)
continue;
I can confirm this on a recently installed edgy.
/home was mounted nfs/autofs async and didn't have a problem.
/var/mail was mounted nfs/autofs sync, and opening more than one mutt, or waiting for the timeout, or something made the processes (a couple of mutts and a cat /var/mail/me) accessing /var/mail freeze. Even going to runlevel 1, I still couldn't kill them!
Now I changed the file in the hal source 00upstream- 05-fix- stale_nfs_ handle_ block.patch (in debian/patches)
which already handled the nfs part of the patch. I added the autofs part. And rebuilt and installed the new hal.
As far as I can tell it is solved now. I've opened several mutts, and made different changes to the inbox in different instances, and they are not complaining, but updating correctly.