summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-05-12 21:17:21 +0200
committerJeremy Allison <jra@samba.org>2016-05-21 01:28:28 +0200
commite39436e770b5f6fe9e6615bc70bda627a3a1bd58 (patch)
tree7d23741a1314bfce806428ae56adbd874989942b /source3/locking
parent598538316786188f2d91c6e2c343c8051e27fd68 (diff)
downloadsamba-e39436e770b5f6fe9e6615bc70bda627a3a1bd58.tar.gz
s3: VFS: Map process-associated lock operation to open file description lock operation.
Only in the default VFS. Gpfs, Ceph, Gluster and other modern backend VFS filesystems might want to do the same. Allow tuneable "smbd:force process locks = true" to turn off OFD locks if in use and the kernel doesn't support them. Display debug message showing admins what to do in this case. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/posix.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source3/locking/posix.c b/source3/locking/posix.c
index f3a89fdf508..432637a3dfe 100644
--- a/source3/locking/posix.c
+++ b/source3/locking/posix.c
@@ -198,12 +198,22 @@ static bool posix_fcntl_lock(files_struct *fsp, int op, off_t offset, off_t coun
if (!ret && ((errno == EFBIG) || (errno == ENOLCK) || (errno == EINVAL))) {
- DEBUG(0, ("posix_fcntl_lock: WARNING: lock request at offset "
+ if ((errno == EINVAL) &&
+ (op != F_GETLK &&
+ op != F_SETLK &&
+ op != F_SETLKW)) {
+ DEBUG(0,("WARNING: OFD locks in use and no kernel "
+ "support. Try setting "
+ "'smbd:force process locks = true' "
+ "in smb.conf\n"));
+ } else {
+ DEBUG(0, ("WARNING: lock request at offset "
"%ju, length %ju returned\n",
(uintmax_t)offset, (uintmax_t)count));
- DEBUGADD(0, ("an %s error. This can happen when using 64 bit "
+ DEBUGADD(0, ("an %s error. This can happen when using 64 bit "
"lock offsets\n", strerror(errno)));
- DEBUGADD(0, ("on 32 bit NFS mounted file systems.\n"));
+ DEBUGADD(0, ("on 32 bit NFS mounted file systems.\n"));
+ }
/*
* If the offset is > 0x7FFFFFFF then this will cause problems on