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

MythTV noreply at mythtv.org
Mon Nov 5 15:17:21 UTC 2012


#11221: The use of OpenAndUnlink() in mainserver.cpp::DeleteFile() prevents the use
of CIFS
----------------------------------+----------------------------
 Reporter:  dargllun@…            |          Owner:
     Type:  Bug Report - General  |         Status:  new
 Priority:  minor                 |      Milestone:  unknown
Component:  MythTV - General      |        Version:  0.26-fixes
 Severity:  medium                |     Resolution:
 Keywords:                        |  Ticket locked:  0
----------------------------------+----------------------------

Comment (by dargllun@…):

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

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

 EBUSY
     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").

 One certainly can't help if some other process has an open FD on a file
 one wants to unlink() but open()ing it without need seems a bit like
 asking for trouble. To be honest I was very surprised to learn all this,
 because I've known the open-unlink pattern for a long time and was
 convinced this is standard UNIX. But after all it seems to just be widely
 available with many file systems, but in no way being a feature you can
 take for granted. So defensive code should probably not rely on it.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11221#comment:2>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list