Opened 7 years ago

Closed 11 months ago

#12306 closed Bug Report - General (Unverified)

LiveTV recording hangs on btrfs filesystem

Reported by: cweemin@… Owned by:
Priority: minor Milestone: unknown
Component: MythTV - General Version: 0.27.4
Severity: medium Keywords: livetv btrfs
Cc: Ticket locked: no


This issue comes up when mythtv is recording into a Btrfs filesystem with a default mount option. The default option (commit) for btrfs is set to 30 seconds, and this will cause the backend to freeze intermittently if the write have not commit back to the device. This issue goes away if I change my mount to commit every second.

The fixes made for bug #12045 rely on a system fstat call to determine if EOF is reached. This works for system that commits to the device regularly, but it defeats the purpose of Linux's buffering / caching algorithm. The issue that Jean pointed out was because read() was blocking (hence timed-out) due to EOF. My suggestion is to open the file with O_NONBLOCK for both read/write.

I made my changes to fileringbuffer.cpp to open files with O_NONBLOCK mode and remove the fstat calls, that seems to fix my problem.

Attachments (1)

fileringbuffer.cpp.diff (2.2 KB) - added by cweemin@… 7 years ago.
Diff file

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by cweemin@…

Attachment: fileringbuffer.cpp.diff added

Diff file

comment:1 Changed 11 months ago by Stuart Auchterlonie

Resolution: Unverified
Status: newclosed

Closing all old tickets in trac.

If your issue still persists, please open an issue in Github

and reference the existing trac ticket.

Note: See TracTickets for help on using tickets.