Opened 5 years ago

Last modified 5 weeks ago

#11884 new Bug Report - General

Auto expire fails on non-case sensitive file systems

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

Description

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 (7)

comment:1 Changed 18 months ago by David Hampton <mythtv@…>

comment:2 Changed 18 months ago by Stuart Auchterlonie

Milestone: unknown30.0

comment:3 Changed 18 months 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 18 months 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 18 months ago by Peter Bennett

Replying to David Hampton <mythtv@…>:

Patch submitted as https://github.com/MythTV/mythtv/pull/151

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 18 months 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 5 weeks ago by Stuart Auchterlonie

Milestone: 30.030.1
Note: See TracTickets for help on using tickets.