Opened 8 years ago

Closed 18 months ago

#11884 closed Bug Report - General (Won't Fix)

Auto expire fails on non-case sensitive file systems

Reported by: doug@… Owned by: sphery
Priority: minor Milestone: 31.0
Component: MythTV - Housekeeper Version: 0.27-fixes
Severity: low Keywords:
Cc: Ticket locked: no


On a system with a non-case sensitive file system if the storage path string is set using a different case to the actual underlying file system, programs will record but they will never be expired.

The auto expire process will appear to be working in the logs, except never actually deleting the file. I think the error ultimately occurs at the 'contains' test here in mythtv/mythtv/programs/mythbackend/autoexpire.cpp

592 if (dirList.contains(p->GetHostname?() + ':' + vidFile.path()))

One of the values being compared will be the returned value from the file system, the other will be based on the string in the settings, so they won't match.

Noticed this on my OSX frontend & backend system.

Workaround: store path strings in lower-case

In my case the storage path was originally set to /Volumes/BiggusDiskus/Video? This failed for auto expire

Auto expire worked again when the path was changed to /volumes/biggusdiskus/video

Change History (9)

comment:1 Changed 4 years ago by David Hampton <mythtv@…>

comment:2 Changed 4 years ago by Stuart Auchterlonie

Milestone: unknown30.0

comment:3 Changed 4 years ago by mtdean@…

Are you saying that mythtv-setup put the wrong case for the directory names into the database? Is it unable to get the correct filename? Or did something else edit the value from the database after it was properly set by mythtv-setup?

comment:4 Changed 4 years ago by doug@…

Going back 4 years now, but from memory...

This was on Mac OSX. I set the path in mythtv-setup as it appeared in the Finder, which included case. This was /Volumes/BiggusDiskus/Video?.

No longer using myth (sorry guys, it served me well for many years), so I can't double check.

comment:5 in reply to:  1 Changed 4 years ago by Peter Bennett

Replying to David Hampton <mythtv@…>:

Patch submitted as

I have not examined the fix in detail, but I am concerned whether it may interfere with the correct operation in case sensitive file systems. In particular, if somebody named the storage directory using uppercase in the name as for example /srv/Storage. Also there could be a case where somebody has two storage directories called /srv/Storage and /srv/STORAGE. Definitely not recommended but they may exist out there.

comment:6 Changed 4 years ago by David Hampton <mythtv@…>

I don't think this really affects correct operation of the system. The ExpireRecordings? function first gets a list of files that are deletable. Then, for each file system it attempts to delete files from that list until the file system space requirements are met. I can conconct a scenario where doing case-insensitive comparison could cause one run of ExpireRecordings? to not free up enough space, but the next run of ExpireRecordings? would run correctly.

The scenario is that a user has directories /A and /a, file /a/b is expired, and you are trying to free space on /A. When ExpireRecordings? gets to /a/b in the list of expired files, it will remove it and count the released space towards /A. Given the order of the files in the expired list and the file sizes, this might make ExpireRecordings? stop too soon. On the next run of ExpireRecordings? /a/b will be gone and it will correctly free up the requested amount of space in /A. The only side effect is that the expired recording /a/b would be deleted before space was needed to be freed up on /a.

comment:7 Changed 2 years ago by Stuart Auchterlonie

Milestone: 30.030.1

comment:8 Changed 18 months ago by Mac Michaels

Please close this bug.

I examined the pull request. I do not think this is a proper fix if indeed there is a bug. Apple filesystem is Unicode 9.0 encoded in UTF-8 while linux filesystems are any byte except null. They are both case sensitive.

The pull request for this patch is not applied in the mythtv master tree.

comment:9 Changed 18 months ago by gigem

Milestone: 30.131.0
Resolution: Won't Fix
Status: newclosed
Note: See TracTickets for help on using tickets.