SMBClose without POSIX close()

Emil Rasamat emil at
Sun Jun 22 15:47:33 GMT 2003

Reading the code of fd_close_posix() I found out that when a file is closed, and there are pending locks on other fd’s the original handle is not being close()ed (by calling vfs_ops.close()), rather added to the pending_close_entries list – to be closed later (when there are no more locks pending on this file).
The problem with this behavior is that when a file is opened from two clients (e.g. client1: rw access, client2: r access) and then closed by client1, the file is still open for rw (until the client2 will choose to close the file).
I understand this is a kind of optimization – but I don’t really understand what does it optimize? And I need the semantics to be kept (i.e. when a file is closed – it should be closed).
Can anybody point out what I am missing?
--emil rasamat

More information about the samba-technical mailing list