From mat@cnd184.cnd.mcgill.ca  Wed Nov  6 23:29:40 2002
Return-Path: <mat@cnd184.cnd.mcgill.ca>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6ABAE37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  6 Nov 2002 23:29:40 -0800 (PST)
Received: from cnd184.cnd.mcgill.ca (cnd184.cnd.mcgill.ca [132.216.11.184])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D91BB43E42
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  6 Nov 2002 23:29:39 -0800 (PST)
	(envelope-from mat@cnd184.cnd.mcgill.ca)
Received: from cnd184.cnd.mcgill.ca (localhost [127.0.0.1])
	by cnd184.cnd.mcgill.ca (8.12.6/8.12.6) with ESMTP id gA77Tet6034582
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 7 Nov 2002 02:29:40 -0500 (EST)
	(envelope-from mat@cnd184.cnd.mcgill.ca)
Received: (from mat@localhost)
	by cnd184.cnd.mcgill.ca (8.12.6/8.12.6/Submit) id gA77Tef2034581;
	Thu, 7 Nov 2002 02:29:40 -0500 (EST)
Message-Id: <200211070729.gA77Tef2034581@cnd184.cnd.mcgill.ca>
Date: Thu, 7 Nov 2002 02:29:40 -0500 (EST)
From: Mathew Kanner <mat@cnd.mcgill.ca>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: flexlm does not run with linux-base-7, stops matlab
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45023
>Category:       kern
>Synopsis:       [linux] [patch] flexlm does not run with linux-base-7, stops matlab
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-emulation
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 06 23:30:05 PST 2002
>Closed-Date:    Sat Sep 09 19:52:14 GMT 2006
>Last-Modified:  Sat Sep 09 19:52:14 GMT 2006
>Originator:     Mathew Kanner
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
>Environment:
System: FreeBSD cnd184.cnd.mcgill.ca 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Oct 9 15:08:34 GMT 2002 root@builder.freebsdmall.com:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

FlexLM does not work with linux_base-7 but does with linux_base-6.
flock is the apparent cause.  Willem van Engen reported it on
freebsd-emulation on 12/10/2001, and Andrew Gallatin proposes the
solution here.

flexlm gives the vague error message:
cannot establish lock - exiting (file: "", errno: 22)

This allows me to run matlab

>How-To-Repeat:
	Run flexlm with linux-base-7
	
>Fix:

--- /usr/src/sys/compat/linux/linux_file.c	Mon Nov  5 14:08:22 2001
+++ /usr/src/sys/compat/linux/linux_file.c.new	Thu Nov  7 02:16:51 2002
@@ -766,8 +766,8 @@
 	}
 	bsd_flock->l_whence = linux_flock->l_whence;
 	bsd_flock->l_start = (off_t)linux_flock->l_start;
-	bsd_flock->l_len = (off_t)linux_flock->l_len;
-	bsd_flock->l_pid = (pid_t)linux_flock->l_pid;
+	bsd_flock->l_pid = 0;
+	bsd_flock->l_len = 0;
 }
 
 static void
@@ -818,8 +818,8 @@
 	}
 	bsd_flock->l_whence = linux_flock->l_whence;
 	bsd_flock->l_start = (off_t)linux_flock->l_start;
-	bsd_flock->l_len = (off_t)linux_flock->l_len;
-	bsd_flock->l_pid = (pid_t)linux_flock->l_pid;
+	bsd_flock->l_pid = 0;
+	bsd_flock->l_len = 0;
 }
 
 static void
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->emulation 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Aug 26 20:13:18 GMT 2004 
Responsible-Changed-Why:  
Reassign to appropriate mailing list. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45023 
State-Changed-From-To: open->feedback 
State-Changed-By: netchild 
State-Changed-When: Thu Dec 29 15:41:43 UTC 2005 
State-Changed-Why:  
Is this still a problem with a recent FreeBSD? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45023 
State-Changed-From-To: feedback->closed 
State-Changed-By: netchild 
State-Changed-When: Sat Sep 9 19:50:09 UTC 2006 
State-Changed-Why:  
Close: 
- feedback timeout: 9 months 
- rdivacky thinks this does not make much sense, the pid is nowhere used (the 
VOP_ADVLOCK sets that only - posix thing) and len is set to 0 anyway 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45023 
>Unformatted:
