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
bool result;
START_PROFILE(syscall_fcntl_lock);
+
+ if (fsp->use_ofd_locks || !lp_parm_bool(SNUM(fsp->conn),
+ "smbd",
+ "force process locks",
+ false)) {
+ op = map_process_lock_to_ofd_lock(op, &fsp->use_ofd_locks);
+ }
+
result = fcntl_lock(fsp->fh->fd, op, offset, count, type);
END_PROFILE(syscall_fcntl_lock);
return result;
int op = F_GETLK;
START_PROFILE(syscall_fcntl_getlock);
+
+ if (fsp->use_ofd_locks || !lp_parm_bool(SNUM(fsp->conn),
+ "smbd",
+ "force process locks",
+ false)) {
+ op = map_process_lock_to_ofd_lock(op, &fsp->use_ofd_locks);
+ }
+
result = fcntl_getlock(fsp->fh->fd, op, poffset, pcount, ptype, ppid);
END_PROFILE(syscall_fcntl_getlock);
return result;