Re: [oi-dev] weird flock problem

2017-11-13 Thread Carsten Grzemba

On 13.11.17 16:26, Toomas Soome   wrote: 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > 
> > On 13 Nov 2017, at 17:07, Till Wegmüller  wrote:
> > 
> > 
> > On 13.11.2017 15:59, Carsten Grzemba wrote: 
> > 
> > > 
> > > 
> > > On 13.11.17 15:16, *Bob Friesenhahn *  
> > > wrote:
> > > 
> > > > On Mon, 13 Nov 2017, Carsten Grzemba wrote:
> > > > 
> > > > > 
> > > > > This compiles on Openindiana without an error, but if it runs throws
> > > > > 
> > > > the error: Invalid argument (os error 22)
> > > > 
> > > > > 
> > > > > If I copy this on Openindiana compiled code to Smartos it runs 
> > > > > correctly.
> > > > > 
> > > > 
> > > > Are you using the same filesystem on both systems? For example, zfs
> > > > vs tmp on swap could make a difference. Or something to do with
> > > > filesystem paths.
> > > > 
> > > Thats the clue:
> > > it fails on NFS, but works on ZFS and TMPFS
> > > 
> > 
> > Doesn't NFS require a special lock daemon to be setup between server and 
> > client? AFAIk NFS locking is quite limted when i last tried it years ago. 
> > 
> > 
> > 
> 
> 
> NFSv2/NFSv3 has separate locking protocol and implementation, NFSv4 has 
> locking integrated.
> 
> 
>  
> 
I my case, it fails on NFSv4.

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

Re: [oi-dev] weird flock problem

2017-11-13 Thread Toomas Soome


> On 13 Nov 2017, at 17:07, Till Wegmüller  wrote:
> 
> On 13.11.2017 15:59, Carsten Grzemba wrote:
>> 
>> 
>> On 13.11.17 15:16, *Bob Friesenhahn *  wrote:
>>> On Mon, 13 Nov 2017, Carsten Grzemba wrote:
 
 This compiles on Openindiana without an error, but if it runs throws
>>> the error: Invalid argument (os error 22)
 
 If I copy this on Openindiana compiled code to Smartos it runs correctly.
>>> 
>>> Are you using the same filesystem on both systems?  For example, zfs
>>> vs tmp on swap could make a difference.  Or something to do with
>>> filesystem paths.
>> Thats the clue:
>> it fails on NFS, but works on ZFS and TMPFS
> 
> Doesn't NFS require a special lock daemon to be setup between server and
> client? AFAIk NFS locking is quite limted when i last tried it years ago.
> 

NFSv2/NFSv3 has separate locking protocol and implementation, NFSv4 has locking 
integrated.

rgds,
toomas

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

Re: [oi-dev] weird flock problem

2017-11-13 Thread Udo Grabowski (IMK)

On 13/11/2017 16:07, Till Wegmüller wrote:

On 13.11.2017 15:59, Carsten Grzemba wrote:



On 13.11.17 15:16, *Bob Friesenhahn *  wrote:

On Mon, 13 Nov 2017, Carsten Grzemba wrote:


This compiles on Openindiana without an error, but if it runs throws

the error: Invalid argument (os error 22)


If I copy this on Openindiana compiled code to Smartos it runs correctly.


Are you using the same filesystem on both systems?  For example, zfs
vs tmp on swap could make a difference.  Or something to do with
filesystem paths.

Thats the clue:
it fails on NFS, but works on ZFS and TMPFS


Doesn't NFS require a special lock daemon to be setup between server and
client? AFAIk NFS locking is quite limted when i last tried it years ago.



See Jerry's explanation in an older thread regarding Robert's 3252
submission:

--
Dr.Udo Grabowski   Inst.f.Meteorology & Climate Research IMK-ASF-SAT
http://www.imk-asf.kit.edu/english/sat.php
KIT - Karlsruhe Institute of Technology   http://www.kit.edu
Postfach 3640,76021 Karlsruhe,Germany T:(+49)721 608-26026 F:-926026



smime.p7s
Description: S/MIME Cryptographic Signature
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

Re: [oi-dev] weird flock problem

2017-11-13 Thread Till Wegmüller
On 13.11.2017 15:59, Carsten Grzemba wrote:
> 
> 
> On 13.11.17 15:16, *Bob Friesenhahn *  wrote:
>> On Mon, 13 Nov 2017, Carsten Grzemba wrote:
>> >
>> >This compiles on Openindiana without an error, but if it runs throws
>> the error: Invalid argument (os error 22)
>> >
>> >If I copy this on Openindiana compiled code to Smartos it runs correctly.
>>
>> Are you using the same filesystem on both systems?  For example, zfs
>> vs tmp on swap could make a difference.  Or something to do with
>> filesystem paths.
> Thats the clue:
> it fails on NFS, but works on ZFS and TMPFS

Doesn't NFS require a special lock daemon to be setup between server and
client? AFAIk NFS locking is quite limted when i last tried it years ago.

Greetings
Till

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] weird flock problem

2017-11-13 Thread Carsten Grzemba


On 13.11.17 15:16, Bob Friesenhahn   wrote: 
> 
> On Mon, 13 Nov 2017, Carsten Grzemba wrote:
> >
> >This compiles on Openindiana without an error, but if it runs throws the 
> >error: Invalid argument (os error 22)
> >
> >If I copy this on Openindiana compiled code to Smartos it runs correctly.
> 
> Are you using the same filesystem on both systems? For example, zfs vs tmp on 
> swap could make a difference. Or something to do with filesystem paths.
> 
Thats the clue: 
it fails on NFS, but works on ZFS and TMPFS
___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev

Re: [oi-dev] weird flock problem

2017-11-13 Thread Bob Friesenhahn

On Mon, 13 Nov 2017, Carsten Grzemba wrote:


This compiles on Openindiana without an error, but if it runs throws the error: 
Invalid argument (os error 22)

If I copy this on Openindiana compiled code to Smartos it runs correctly.


Are you using the same filesystem on both systems?  For example, zfs 
vs tmp on swap could make a difference.  Or something to do with 
filesystem paths.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


Re: [oi-dev] weird flock problem

2017-11-13 Thread Alexander Pyhalov

On 11/13/17 11:42 AM, Carsten Grzemba wrote:

I ran in a problem with error message on openindiana:

fcntl: Invalid argument

I wrot short test program:

#include 
#include 
#include 
#include 


int main() {
  struct flock64 l;
  FILE *fp;

  l.l_whence = SEEK_SET;
  l.l_start = 0;
  l.l_len = 0;
  l.l_sysid = 0;
  l.l_pid = 0;

  fp = fopen("flocktest.c", "r");
  if (fp == NULL) {
  perror("fopen");
  exit(1);
  }
  l.l_type = F_UNLCK;
  if (fcntl(fileno(fp), F_FLOCK, ) != 0) {
  perror("fcntl");
  exit(1);
  }
  printf("flocktest.c locked\n");
  return 0;
}

This compiles on Openindiana without an error, but if it runs throws the error: 
Invalid argument (os error 22)



Works for me.

$ ./flocktest
flocktest.c locked

Running illumos-cbe94e1756  (November, 3rd).
--
Best regards,
Alexander Pyhalov,
system administrator of Southern Federal University IT department

___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev


[oi-dev] weird flock problem

2017-11-13 Thread Carsten Grzemba
I ran in a problem with error message on openindiana:

fcntl: Invalid argument

I wrot short test program:

#include 
#include 
#include 
#include 


int main() {
 struct flock64 l;
 FILE *fp;

 l.l_whence = SEEK_SET;
 l.l_start = 0;
 l.l_len = 0;
 l.l_sysid = 0;
 l.l_pid = 0;

 fp = fopen("flocktest.c", "r");
 if (fp == NULL) {
 perror("fopen");
 exit(1);
 }
 l.l_type = F_UNLCK;
 if (fcntl(fileno(fp), F_FLOCK, ) != 0) {
 perror("fcntl");
 exit(1);
 }
 printf("flocktest.c locked\n");
 return 0;
}

This compiles on Openindiana without an error, but if it runs throws the error: 
Invalid argument (os error 22)

If I copy this on Openindiana compiled code to Smartos it runs correctly.

OI illumos version:
SunOS oi-sr 5.11 illumos-2ee1ed1ec5 i86pc i386 i86pc
Which is:
git show 2ee1ed1ec5
commit 2ee1ed1ec5dfdf07d2c92db58b11f630de2a6e87
Author: Dan McDonald 
Date: Tue Sep 12 17:38:28 2017 -0400

Smartos illumos version:
SunOS smartos 5.11 joyent_20171026T003127Z i86pc i386 i86pc

The libc shows on both the same versions:

$ elfdump -v /lib/libc.so.1

Version Definition Section: .SUNW_version
 index version dependency
 [1] libc.so.1 [ BASE ]
 [2] ILLUMOS_0.24 ILLUMOS_0.23 
 [3] ILLUMOS_0.23 ILLUMOS_0.22 
..8<..

The error message points out that the problem is in kernel.

How can I get running the fcntl flock code on Openindiana? 
The kernel builds seems to be nearly the same, but not exactly. The F_FLOCK 
stuff was added much earlier.
--
 
Carsten


___
oi-dev mailing list
oi-dev@openindiana.org
https://openindiana.org/mailman/listinfo/oi-dev