Re: struct file at VFS level (round 1.5)

2016-05-04 Thread Christoph Badura
On Tue, May 03, 2016 at 12:20:41PM +, Emmanuel Dreyfus wrote: > Well, I need you to explain me what happens in sys_flock() then. > Is it a bug? > error = VOP_ADVLOCK(vp, fp, F_UNLCK, , F_FLOCK); > > fp is struct file. Same thing happens in open_setfp() and closef()

Re: struct file at VFS level (round 1.5)

2016-05-03 Thread J. Hannken-Illjes
> On 03 May 2016, at 14:20, Emmanuel Dreyfus wrote: > > On Tue, May 03, 2016 at 12:05:01PM +0200, Christoph Badura wrote: >> Didn't I just explain to you that a struct file is never an owner for >> these locks? Didn't others explain that to you too? > > Well, I need you to

Re: struct file at VFS level (round 1.5)

2016-05-03 Thread Emmanuel Dreyfus
On Tue, May 03, 2016 at 12:05:01PM +0200, Christoph Badura wrote: > Didn't I just explain to you that a struct file is never an owner for > these locks? Didn't others explain that to you too? Well, I need you to explain me what happens in sys_flock() then. Is it a bug? error =

Re: struct file at VFS level (round 1.5)

2016-05-03 Thread Christoph Badura
On Tue, May 03, 2016 at 08:20:02AM +, Emmanuel Dreyfus wrote: > On Tue, May 03, 2016 at 09:30:22AM +0200, Christoph Badura wrote: > > - for the write case > >off = current_file_offset > >VOP_ADVLOCK(F_WRLCK, off, size_of_write) > >VOP_WRITE(...) > >VOP_ADVLOCK(F_UNLCK, off,

Re: struct file at VFS level (round 1.5)

2016-05-03 Thread Emmanuel Dreyfus
On Tue, May 03, 2016 at 09:30:22AM +0200, Christoph Badura wrote: > - for the write case >off = current_file_offset >VOP_ADVLOCK(F_WRLCK, off, size_of_write) >VOP_WRITE(...) >VOP_ADVLOCK(F_UNLCK, off, size_of_write) There is still the problem to set the appropriate lock owner

Re: struct file at VFS level (round 1.5)

2016-05-03 Thread Christoph Badura
On Tue, May 03, 2016 at 05:33:34AM +0200, Emmanuel Dreyfus wrote: > Christoph Badura wrote: > > > Mandatory file locking simply is a SMOP for the kernel to add a flag to a > > vnode that indicates whether mandatory locking is in effect and adding the > > necessary checks and

Re: struct file at VFS level (round 1.5)

2016-05-02 Thread Emmanuel Dreyfus
Christoph Badura wrote: > Mandatory file locking simply is a SMOP for the kernel to add a flag to a > vnode that indicates whether mandatory locking is in effect and adding the > necessary checks and interaction with file systems to open(2), read(2), > write(2) etc. at the syscall

Re: struct file at VFS level (round 1.5)

2016-05-02 Thread Christoph Badura
On Mon, May 02, 2016 at 07:15:12AM +, Emmanuel Dreyfus wrote: > NetBSD filesystems implement advisory locks, where the only place the > filesystem actually check locks as VOP_ADVLOCK. Any other operation > performed on a file region locked by someone else succeeds: the locks > are only

struct file at VFS level (round 1.5)

2016-05-02 Thread Emmanuel Dreyfus
Hello I try to summarize the thing so far. NetBSD filesystems implement advisory locks, where the only place the filesystem actually check locks as VOP_ADVLOCK. Any other operation performed on a file region locked by someone else succeeds: the locks are only advisory, and it is the application