SMB CIFS OpLocks - where is the danger?

by masgo   Last Updated September 11, 2019 11:01 AM

I had some CIFS messages in my dmesg output

[15064.932559] CIFS VFS: Cancelling wait for mid 37736 cmd: 5
[15064.932592] CIFS VFS: Cancelling wait for mid 37737 cmd: 16
[15064.932610] CIFS VFS: Cancelling wait for mid 37738 cmd: 6
[15066.212283] CIFS VFS: Close unmatched open

and startet to dig around where they come from. In the end I found out it has to do with opportunistic locking on the samba share. I found many articles arguing that enable_oplocks will increase performance. There where also as many articles claiming that using oplocks may cause dataloss. My question is: why would dataloss happen?

I found an explaination of how oplocks work (Figure 5.8). There is also some explaination that if the linux kernel does not support oplocks things might break. But can something go wrong if it does support it?

Also: how can I test if my kernel does support oplocks?

I am looking for answers where I learn how oplocks work and how they are implemented/handled in linux, rathern than answers dealing with my specific linux distribution.

Tags : linux samba cifs lock


Related Questions


Updated June 17, 2017 14:01 PM

Updated October 07, 2018 10:01 AM

Updated March 28, 2015 10:00 AM

Updated October 22, 2015 08:00 AM

Updated May 17, 2017 22:01 PM