[mythtv] Ticket #11221: The use of OpenAndUnlink() in mainserver.cpp::DeleteFile() prevents the use of CIFS

Greg G. dargllun at googlemail.com
Mon Nov 5 15:38:51 UTC 2012

Ok knowing that the mythtv folks don't like bug discussion in Trac, I
subscribed to mythtv-dev.

mtdean wrote:
> Users of CIFS file systems should not enable the setting:
> Delete files slowly

The bug happens regardless of the "Delete files slowly" setting. Looking
into the source code confirms this has no relevance here.

On Nov 4, 2012, raymond at wagnerrp wrote:
> In order to maintain consistency, it completely breaks with
> conventional filesystem behavior on POSIX systems? That makes sense.

To be sure, I'm not defending anything here, in fact I'm still baffled
by this as well. For completeness, here is what probably led to unlink()
returning EBUSY for cifs:


Please also note that unlink(2) returning EBUSY is perfectly legal,
quoting from the man page:

    The file pathname cannot be unlinked because it is being used by the
system or another process; for example, it is a mount point or the NFS
client software created it to represent an active but otherwise nameless
inode ("NFS silly renamed").

We don't have to like this, but that's what the facts are. Defensive
coding should not rely on open-unlink to work.


More information about the mythtv-dev mailing list