Bug 7756 - hal + kernel 2.6.18-rc, devices fail to automount
Summary: hal + kernel 2.6.18-rc, devices fail to automount
Status: RESOLVED NOTOURBUG
Alias: None
Product: hal
Classification: Unclassified
Component: hald (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact:
URL: https://bugzilla.redhat.com/bugzilla/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-03 11:13 UTC by Andrew Clayton
Modified: 2008-01-03 17:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Kernel config for x86 2.6.18-rc2 (25.70 KB, text/plain)
2006-08-03 14:16 UTC, Andrew Clayton
Details
kernel config for athlon, 2.6.18-rc3 (28.30 KB, text/plain)
2006-08-04 02:08 UTC, Andrew Clayton
Details
lshal outpout from hal-0.5.8cvs (62.64 KB, text/plain)
2006-08-04 02:20 UTC, Andrew Clayton
Details
Output from /usr/sbin/hald --daemon=no --verbose=yes (12.49 KB, text/plain)
2006-08-04 02:23 UTC, Andrew Clayton
Details
Output from hald from git as of 2007-08-03 (16.60 KB, text/plain)
2006-08-04 02:35 UTC, Andrew Clayton
Details

Description Andrew Clayton 2006-08-03 11:13:32 UTC
Using HAL hal-0.5.7.1-2.fc5 on i386, also tried hal-0.5.8-cvs20060714rhughes
on Fedora Core 5 with a 2.8.18-rc[23] kernel, devices no longer get
automatically mounted (this is under GNOME). This is on i386/FC, on x86_64/FC it
works fine.

More details can be found in that redhat bugzilla url.

Cheers,

Andrew
Comment 1 David Zeuthen (not reading bugmail) 2006-08-03 12:06:28 UTC
What's the kernel config?

Thanks
Comment 2 Andrew Clayton 2006-08-03 14:16:31 UTC
Created attachment 6446 [details]
Kernel config for x86 2.6.18-rc2

config.i386 is for the machine where hal seems to fail.
Comment 3 David Zeuthen (not reading bugmail) 2006-08-03 15:12:56 UTC
Hmm, weird. Try attaching output of lshal after hald is started... and try running 

 # service haldemon stop
 # /usr/sbin/hald --daemon=no --verbose=yes

wait for the output to finish... then plug in your device and put the new output
spew from hald in an attachment. Thanks. It would also be useful if you can test
this from git HEAD of hal. See this file for how to obtain it

 http://gitweb.freedesktop.org/?p=hal;a=blob;hb=HEAD;f=HACKING

Note you don't need to 'make install' the new HAL - you can run it via
hald/run-hald.sh (as root) from the build directory. Thanks.
Comment 4 Andrew Clayton 2006-08-04 02:08:31 UTC
Created attachment 6450 [details]
kernel config for athlon, 2.6.18-rc3

I am trying another machine that has the same problem that I have easier access
to.
Comment 5 Andrew Clayton 2006-08-04 02:18:49 UTC
This machine is running 2.6.18-rc3 and hal 0.5.8-cvs20060714rhughes from the
Fedora Utopia repo.

I rebooted this machine last night into 2.6.18-rc3, came into work this morning
plugged in the usbstick and low and behold it mounted it. I unmounted an
replugged  it but this time it didn't get mounted.

(I double checked my x86-64 workstation is still working, 2.6.18-rc3, hal
0.5.7.1-2.fc5 both i386 ans x86-64 versions it seems. Plugged the stick in, it
mounted. Unmounted, replugged and it and it mounted again.)


So onto the debugging.

Comment 6 Andrew Clayton 2006-08-04 02:20:21 UTC
Created attachment 6451 [details]
lshal outpout from hal-0.5.8cvs

This is the output of lshal from 0.5.8cvs with the usbstick plugged in.
Comment 7 Andrew Clayton 2006-08-04 02:23:28 UTC
Created attachment 6452 [details]
Output from /usr/sbin/hald --daemon=no --verbose=yes

This is the output from /usr/sbin/hald --daemon=no --verbose=yes (hal 0.5.8cvs)
from when the device was plugged in.
Comment 8 Andrew Clayton 2006-08-04 02:35:21 UTC
Created attachment 6453 [details]
Output from hald from git as of 2007-08-03

This is the output from running hald checked out from git, when the device was
plugged in (it also includes when the device was removed).

The stick didn't get mounted.

Cheers,
Comment 9 David Zeuthen (not reading bugmail) 2006-08-04 06:59:52 UTC
This looks wrong:

10:29:22.344 [E] util.c:516: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host4/target4:0:0/4:0:0:0/model'
10:29:22.344 [E] util.c:516: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host4/target4:0:0/4:0:0:0/vendor'
10:29:22.344 [E] util.c:324: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host4/target4:0:0/4:0:0:0/type'
scandir: Permission denied
scandir: Permission denied
scandir: Permission denied

hald drops privileges to the unprivileged user haldaemon... and the permissions
on sysfs looks wrong because apparently the haldaemon user cannot access it...
Can a unprivileged user read e.g. 

 /sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host4/target4:0:0/4:0:0:0/model

If he can't you probably misconfigured the kernel and/or mounted /sys with wrong
permissions... Thanks.


Comment 10 Andrew Clayton 2006-08-04 07:43:38 UTC
OK, I tried again.

sysfs is mounted as

none on /sys type sysfs (rw)

from /etc/fstab

none                    /sys                    sysfs   defaults        0 0

And I as a normal user can browse around in there.

I re-ran the ./run-hald.sh and then plugged in a usb stick.

I seen the errors you pointed out.

15:34:55.556 [E] util.c:516: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host6/target6:0:0/6:0:0:0/model'
15:34:55.556 [E] util.c:516: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host6/target6:0:0/6:0:0:0/vendor'
15:34:55.556 [E] util.c:324: Cannot open
'/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host6/target6:0:0/6:0:0:0/type'
scandir: Permission denied
scandir: Permission denied
scandir: Permission denied

However I (as a normal user) can read these files just fine.

i.e
[andrew@dev-c:/sys/devices/pci0000:00/0000:00:03.2/usb1/1-5/1-5:1.0/host6/target6:0:0/6:0:0:0]$
ls -l model type vendor

-r--r--r-- 1 root root 4096 Aug  4 15:34 model
-r--r--r-- 1 root root 4096 Aug  4 15:34 type
-r--r--r-- 1 root root 4096 Aug  4 15:34 vendor

and 

cat model type vendor

 USB Flash Drive
0
Imation


It's a weird one, as my x86-64 workstation with 2.6.18-rc3 is working fine.


Thanks for looking anyways...
Comment 11 Andrew Clayton 2006-08-04 07:47:31 UTC
Further down we have:


15:34:56.684 [I] blockdev.c:763: block_add: sysfs_path=/sys/block/sda/sda1
dev=/dev/sda1 is_part=1, parent=0x00000000
15:34:56.684 [W] blockdev.c:798: Unable to open /sys/block/sda/sda1/slaves:
Error opening directory '/sys/block/sda/sda1/slaves': No such file or directory
15:34:56.684 [I] blockdev.c:849: Ignoring hotplug event - no parent
15:34:56.684 [W] blockdev.c:1255: Not adding device object


True enough /sys/block/sda/sda1/slaves doesn't exist. Problem?

What we have in /sys/block/sda/sda1/ is

-r--r--r-- 1 root root 4096 Aug  4 15:34 dev
drwxr-xr-x 2 root root    0 Aug  4 15:34 holders
-r--r--r-- 1 root root 4096 Aug  4 15:45 size
-r--r--r-- 1 root root 4096 Aug  4 15:45 start
-r--r--r-- 1 root root 4096 Aug  4 15:45 stat
lrwxrwxrwx 1 root root    0 Aug  4 15:34 subsystem -> ../../../block
--w------- 1 root root 4096 Aug  4 15:45 uevent



Cheers.
Comment 12 David Zeuthen (not reading bugmail) 2006-08-04 12:00:11 UTC
> True enough /sys/block/sda/sda1/slaves doesn't exist. Problem?

Nope, this was a cosmetic error. It sounds like some issue with your kernel that
hald can't read the sysfs files. It works fine for me and others (I had Kay test
2.6.18-rc3 too) so I'm closing this bug. If you find the culprit please update
the bug! Thanks!
Comment 13 David Zeuthen (not reading bugmail) 2006-08-04 12:00:45 UTC
> Nope, this was a cosmetic error.

Which I might add is pushed to the git master repo.
Comment 14 Nickolay V. Shmyrev 2006-09-03 11:34:05 UTC
I have the same bug, see also 

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175892
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200047

It looks that files are created after some delay while hal searching for them
in early beginning. It might be race condition here.
Comment 15 Nickolay V. Shmyrev 2006-09-03 13:13:37 UTC
One probably needs to add WAIT_FOR_SYSFS into udev rules for hal
Comment 16 Nickolay V. Shmyrev 2006-09-03 14:29:49 UTC
This line from redhat's udev patch for rules fixes the problem:

ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
Comment 17 Danny Kukawka 2008-01-03 17:52:18 UTC
Okay, then it's not a HAL problem. Close it now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.