From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve French Subject: turning off posix advisory locks and falling back to mandatory locks Date: Mon, 26 Jun 2006 12:57:38 -0500 Message-ID: <44A02012.3000909@austin.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from ms-smtp-03.texas.rr.com ([24.93.47.42]:6842 "EHLO ms-smtp-03.texas.rr.com") by vger.kernel.org with ESMTP id S1751236AbWFZR5L (ORCPT ); Mon, 26 Jun 2006 13:57:11 -0400 To: shaggy@austin.ibm.com, linux-fsdevel@vger.kernel.org, linux-cifs-client@lists.samba.org Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org If we remove the check on (roughly) line 647 of fs/cifs/file.c for the experimental flag (/proc/fs/cifs/Experimental) - we will do posix style advisory locking (remotely) to Samba and any other current servers which implement the POSIX protocol extensions to cifs - rather than map to mandatory locks as before. This is the correct default behavior now that the code has been out there a while and tests out ok. But would this ever need to be turned off (ie different options than are available now)? 1) default - POSIX advisory locking if server claims support for CIFS_UNIX_FCNTL_CAP in its CIFS Unix Extensions capability - otherwise map advisory locks to mandatory locks 2) if "nobrl" mount option, the client only sets/gets/enforces byte range locks locally (does not send them to the server) which is the best we can do for some important (albeit oddly coded) apps (which e.g. use different file handles to write than the one they used to get the lock) when run to Windows servers 3) turn off Unix extensions (/proc/fs/cifs/LinuxExtensionsEnabled) which has the effect of turning off posix byte range locking, but also symlinks and a few other things only supported when the Unix Extensions are negotiated Is there a need for another cifs mount option (to allow someone to turn off posix advisory locking on the mount - and use manadotory - but still use the rest of the CIFS Unix/POSIX protocol extensions? Although there is an sb flag MS_MANDLOCK (which mount.cifs sets), I don't think that using MS_MANDLOCK helps much - and we should probably turn it off when the server supports mandatory locks.