no oplock on new files

Steven French sfrench at
Thu Feb 19 05:13:16 GMT 2004

Saw traces today of the Linux cifs vfs client opening files to Samba 3.0.1
server in which newly created files (open if exist, create if new) were not
granted an oplock by Samba, but an opens of an existing different file was
granted the oplock (the client had requested an oplock in each case).

>From a quick check of the open code in smbd it looks like the open is done
before the lease request to the kernel so I could see no obvious reason why
Samba would be denying oplock on new files unless this is a sideeffect of
Samba running on 2.6 Linux kernel which seems unlikely

Ideas?  Is this a performance bug, or is there some valid reason that new
files in at least some cases would not be oplockable?

Although it was useful in a way (in helping me find an unrelated problem in
some client code I was testing), it has got to be a performance problem at
least with the cifs vfs when running on 2.6 since with the 2.6 kernel
including the possibility of taking advantage of "lookup intents" - there
is no longer the need for the redundant opencreate/close/open sequence that
you would see in 2.4 - but you also won't get oplock for subsequent writes
unless the new file is explicitly closed by the app

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com

More information about the samba-technical mailing list