Hi, All, I went through the source code (smbd/files.c) already, I got some information about oplocks there, so my previous problem is not the problem :) =20 But I still have a question: If I disable the 'kernel oplocks' and enable 'oplocks', if I edit and save a file on Samba client, can I get the changes right away ( using vi to open the same file under Linux )? My results are all same when I disable or enable 'kernel oplocks'. Has anybody experience this problem? Juer>-----Original Message----- >From: Juer Lee=20 >Sent: 17 September 2001 10:08 >To: Gerald Carter; ian j hart >Cc: samba@lists.samba.org >Subject: RE: kernel oplocks 2.2.1a > > >Hi, Guys, > >I think there still are some problems with OPLOCK. >I installed Samba2.2.1a on my SuseLinux7.1, my kernel is using 2.4.5 >now. >I tried to disable/enable 'kernel oplocks' here.Two results I got: >1.Enable 'kernel oplocks' >In log message, I got 'set_file_lock: got kernel oplock on=20 >file ...' and >'set_file_oplock: granted oplock on file ...', >If I only edited that file and saved it on Samba client, I got >'oplock_break: returning success for dev =3D ...' more > >2.Disable 'kernel oplocks' >In log message, I got 'set_file_oplock: granted oplock on file ...' >only... >If I edit that file and saved it on Samba client, I couldn't get same >message as section 1. > >What I cannot understand is in section 1, why I got 'oplock_break: >returning success ...' even I haven't opened that same file under Linux >box, or NFS client side .. > >Juer
Juer Lee wrote:>If your kernel does not support kernel oplocks (or you do not have them enabled) you cannot use oplocks on a windows client if you will also change the file under linux/nfs. When oplocks are enabled, the client caches all changes to the file until the oplock is broken (by another windows client) or the file is closed. Nothing is sent to the server for write updates until then. Depending on the application you use on the client, "saving" the file means different things.> Hi, All, > > I went through the source code (smbd/files.c) already, I got some > information about oplocks there, so my previous problem is not the > problem :) > But I still have a question: > If I disable the 'kernel oplocks' and enable 'oplocks', if I edit and > save a file on Samba client, can I get the changes right away ( using vi > to open the same file under Linux )? My results are all same when I > disable or enable 'kernel oplocks'. > Has anybody experience this problem? > > Juer >-- =====================================================================Herb Lewis Silicon Graphics Networking Engineer 1600 Amphitheatre Pkwy MS-510 Strategic Software Organization Mountain View, CA 94043-1351 herb@sgi.com Tel: 650-933-2177 http://www.sgi.com Fax: 650-932-2177 ======================================================================
Thank you very much. Yes, all documents about oplocks says that don't enable oplocks if the kernel doesn't support kernel oplock when the file possibly be changed by linux/nfs.My question is that if I disable the 'kernel oplocks' and enable 'oplocks', what on earth will happen? Can I produce some conflicts of that ? Juer>> >If your kernel does not support kernel oplocks (or you do not have >them enabled) you cannot use oplocks on a windows client if you >will also change the file under linux/nfs. When oplocks are enabled, >the client caches all changes to the file until the oplock is >broken (by another windows client) or the file is closed. Nothing >is sent to the server for write updates until then. Depending on >the application you use on the client, "saving" the file means >different things. > >> Hi, All, >> >> I went through the source code (smbd/files.c) already, I got some >> information about oplocks there, so my previous problem is not the >> problem :) >> But I still have a question: >> If I disable the 'kernel oplocks' and enable 'oplocks', if I edit and >> save a file on Samba client, can I get the changes right >away ( using vi >> to open the same file under Linux )? My results are all same when I >> disable or enable 'kernel oplocks'. >> Has anybody experience this problem? >> >> Juer >> > >-- >=====================================================================>Herb Lewis Silicon Graphics >Networking Engineer 1600 Amphitheatre Pkwy MS-510 >Strategic Software Organization Mountain View, CA 94043-1351 >herb@sgi.com Tel: 650-933-2177 >http://www.sgi.com Fax: 650-932-2177 >=====================================================================>