Opened 16 years ago
Closed 16 years ago
#4455 closed defect (fixed)
isMount() bug in MediaMonitor
Reported by: | stuartm | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | high | Keywords: | |
Cc: | Ticket locked: | no |
Description
MythMediaDevice::isMounted compares the device name for our mount against the list in the mounts file. However it doesn't account for symlinks between devices.
/dev/cdrom is symlinked to /dev/hdc /dev/cdrom is mounted to /mnt/cdrom, but the mounts file shows /dev/hdc => /mnt/cdrom
isMounted() looks for /dev/cdrom and can't find it, so fails. The MediaMonitor? then gets stuck in a loop trying but constantly failing to mount the device.
Change History (6)
comment:1 Changed 16 years ago by
Owner: | changed from Isaac Richards to Nigel |
---|---|
Status: | new → accepted |
comment:2 Changed 16 years ago by
comment:3 Changed 16 years ago by
comment:4 Changed 16 years ago by
Owner: | Nigel deleted |
---|---|
Status: | accepted → new |
I haven't reproduced the original problem yet. My test machine does:
% ls -l /dev/cdrom lrwxrwxrwx 1 root root 3 Jan 8 13:18 /dev/cdrom -> hdc % mount /dev/cdrom % egrep cd /proc/mounts /dev/cdrom /cdrom iso9660 ro,nosuid,nodev,noexec 0 0
but that is different from the described behavior (/dev/hdc in mounts).
As far as I can tell, isMounted() does process symlinks (and put them into an unneeded variable deviceNames). Sorry Stuart, I might need some -v media output, fstab, /proc/mounts before and during mythfrontend, et c.
comment:5 Changed 16 years ago by
With a manual mount command line, can reproduce:
% sudo mount /dev/hdc /media mount: block device /dev/hdc is write-protected, mounting read-only % egrep cdrom /proc/mounts /dev/hdc /cdrom iso9660 ro,nosuid,nodev,noexec 0 0
but that doesn't cause any looping, because mythfrontend will just create a second mount which corresponds to the paths in /etc/fstab. I will add some extra symlink checking in isMounted(). but I have no idea if this fixes the reported problem.
Amazing - I have been testing hard for a few days, but haven't seen that one yet!
Looks simple enough. Hopefully I can fix it without breaking too much else :-) There are a few other places where device symlinks should be followed, so I will add something to the base object.