vfs_getlock vs. vfs_lock(F_GETLK)

James Peach jpeach at samba.org
Thu Apr 5 19:26:41 GMT 2007


On Apr 5, 2007, at 10:13 AM, Jeremy Allison wrote:

> On Thu, Apr 05, 2007 at 10:11:37AM -0700, James Peach wrote:
>> Hi Jeremy,
>>
>> Since there are separate SMB_VFS_LOCK and SMB_VFS_GETLOCK calls, is  
>> it
>> safe to assert that F_GETLK is an invalid type for the SMB_VFS_LOCK
>> call?
>
> Hmmmm. Yeah, I think so. Need to look at the code to be
> sure though...

Any problems with this patch (for SAMBA_3_0 only)?

Index: SAMBA_3_0/source/modules/vfs_default.c
===================================================================
--- SAMBA_3_0/source/modules/vfs_default.c	(revision 22079)
+++ SAMBA_3_0/source/modules/vfs_default.c	(working copy)
@@ -781,6 +781,9 @@
  {
  	BOOL result;

+	/* SMB_VFS_GETLOCK should be used to query lock status. */
+	SMB_ASSERT(op != SMB_F_GETLK);
+
  	START_PROFILE(syscall_fcntl_lock);
  	result =  fcntl_lock(fd, op, offset, count, type);
  	END_PROFILE(syscall_fcntl_lock);


--
James Peach | jpeach at samba.org



More information about the samba-technical mailing list