Opened 12 years ago

Closed 12 years ago

#3815 closed defect (invalid)

Bugs in MediaMonitorUnix

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

There are two problems with MediaMonitorUnix?:

  1. When it scans /sys/block/<devicename> for partitions it treats file names as directories and tries to cd (change directory) into them. This of course fails and then the corresponding cdUp() leaves the QDir object a directory above where it is supposed to be. This then causes undefined behaviour (in my case I was getting MediaEvents? telling me that $HOME had just been mounted). The attached patch fixes this.
  1. The committed changes for ticket #3662 are not quite correct. Although they will stop /dev/sda itself from being monitored, partitions in /dev/sda will still be checked by FindPartitions?() and then the call to AddDevice?() will succeed. MythHDD::checkMedia() will then attempt to mount the partitions (which in my case fails, but it shouldn't be called at all if the device is to be ignored). shouldIgnore() should be called at the top of MediaMonitorUnix::FindPartitions?() as per the original patch.

Attachments (1)

check-dirs-only.patch (814 bytes) - added by dburr@… 12 years ago.
Check directory entries only in MediaMonitorUnix?

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by dburr@…

Attachment: check-dirs-only.patch added

Check directory entries only in MediaMonitorUnix?

comment:1 Changed 12 years ago by Daniel Burr

Darn. It appears that the patch does not actually fix the behaviour that I am seeing (although it is still a bug and should be fixed). It seems that MediaMonitor? generates a MediaEvent? for $HOME if mythfrontend is started from .xinitrc via /etc/inittab but not if I issue 'startx' on the command line. As far as I can tell, only devices with /sys/block/<dev>/removable == 1 should be monitored, but the only sda and hda have this on my system. $HOME is mounted via NFS.

comment:2 Changed 12 years ago by Nigel

I haven't investigated 1) yet, but I think 2) is as intended. If the user is using a USB key for /, then /dev/sda1 (or similar) would be in IgnoreDrives?. Other partitions on the same disk might contain valid media that the user does want media. I didn't add any wildcard processing (e.g. /dev/sda*) - I thought the user should explicitly list all partitions that they want to be ignored.

comment:3 Changed 12 years ago by Daniel Burr

Fair enough regarding 2). As for 1), I have discovered that placing a mixed mode data/audio CD into /dev/hda causes the same erroneous behaviour (that is, $HOME is opened in MythGallery). I also noticed that the patch that I suggested above is not necessary because the QDir::Dirs flag is set a few lines above the call to entryList() using setFilter().

comment:4 Changed 12 years ago by Daniel Burr

I finally tracked down problem 1) and it turned out to be a bug in MythGallery, not MythMediaUnix?. I have created a new ticket #3837 with the fix. I think this ticket can be changed to invalid or resolved.

comment:5 Changed 12 years ago by Nigel

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.