Opened 5 years ago

#12306 new Bug Report - General

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

Description

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@… 5 years ago.
Diff file

Download all attachments as: .zip

Change History (1)

Changed 5 years ago by cweemin@…

Attachment: fileringbuffer.cpp.diff added

Diff file

Note: See TracTickets for help on using tickets.