* Question about leases
@ 2002-08-27 1:06 Jan Hudec
2002-08-27 4:35 ` Stephen Rothwell
0 siblings, 1 reply; 6+ messages in thread
From: Jan Hudec @ 2002-08-27 1:06 UTC (permalink / raw)
To: linux-kernel
Hello all,
Please can anyone throw a bit light on file leases (fcntl F_SETLEASE
command) or at least point me to some documentation? I can't find any.
As far as I figured out process holding a lease is notified when other
process opens the leased file. But I am still not sure how the leases
should then be released and how the process knows which lease was broken
(struct siginfo does not seem to have union member for that case).
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about leases
2002-08-27 1:06 Question about leases Jan Hudec
@ 2002-08-27 4:35 ` Stephen Rothwell
2002-08-27 4:44 ` Stephen Rothwell
2002-08-27 8:42 ` Jan Hudec
0 siblings, 2 replies; 6+ messages in thread
From: Stephen Rothwell @ 2002-08-27 4:35 UTC (permalink / raw)
To: Jan Hudec; +Cc: bulb, linux-kernel
On Tue, 27 Aug 2002 03:06:16 +0200 Jan Hudec <bulb@cimice.maxinet.cz> wrote:
>
> Please can anyone throw a bit light on file leases (fcntl F_SETLEASE
> command) or at least point me to some documentation? I can't find any.
There isn't any (except maybe the talk I gave at Linux Kongress
last year (http://www.canb.auug.org.au/~sfr/idle.html).
> As far as I figured out process holding a lease is notified when other
> process opens the leased file. But I am still not sure how the leases
> should then be released and how the process knows which lease was broken
> (struct siginfo does not seem to have union member for that case).
To release a lease, you use fcntl(fd, F_SETLEASE, F_UNLCK). The file
descriptor of the file that the lease is on is returned in the
siginfo structure.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about leases
2002-08-27 4:35 ` Stephen Rothwell
@ 2002-08-27 4:44 ` Stephen Rothwell
2002-09-02 11:29 ` Michael Kerrisk
2002-08-27 8:42 ` Jan Hudec
1 sibling, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2002-08-27 4:44 UTC (permalink / raw)
To: bulb; +Cc: bulb, linux-kernel
Hi again,
On Tue, 27 Aug 2002 14:35:17 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 27 Aug 2002 03:06:16 +0200 Jan Hudec <bulb@cimice.maxinet.cz> wrote:
> >
> > Please can anyone throw a bit light on file leases (fcntl F_SETLEASE
> > command) or at least point me to some documentation? I can't find any.
>
> There isn't any (except maybe the talk I gave at Linux Kongress
> last year (http://www.canb.auug.org.au/~sfr/idle.html).
>
> > As far as I figured out process holding a lease is notified when other
> > process opens the leased file. But I am still not sure how the leases
> > should then be released and how the process knows which lease was broken
> > (struct siginfo does not seem to have union member for that case).
>
> To release a lease, you use fcntl(fd, F_SETLEASE, F_UNLCK). The file
> descriptor of the file that the lease is on is returned in the
> siginfo structure.
You should also be aware that there are lots of bugs with file leases
before 2.4.20-pre3 and in early 2.5 kernels.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about leases
2002-08-27 4:35 ` Stephen Rothwell
2002-08-27 4:44 ` Stephen Rothwell
@ 2002-08-27 8:42 ` Jan Hudec
2002-08-27 12:16 ` Stephen Rothwell
1 sibling, 1 reply; 6+ messages in thread
From: Jan Hudec @ 2002-08-27 8:42 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Jan Hudec, bulb, linux-kernel
On Tue, Aug 27, 2002 at 02:35:17PM +1000, Stephen Rothwell wrote:
> > As far as I figured out process holding a lease is notified when other
> > process opens the leased file. But I am still not sure how the leases
> > should then be released and how the process knows which lease was broken
> > (struct siginfo does not seem to have union member for that case).
>
> To release a lease, you use fcntl(fd, F_SETLEASE, F_UNLCK). The file
> descriptor of the file that the lease is on is returned in the
> siginfo structure.
One more question. Does the siginfo contain information weather is's
read or write that the other process attempted? And does it contain the
operation type for directory notifications?
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about leases
2002-08-27 8:42 ` Jan Hudec
@ 2002-08-27 12:16 ` Stephen Rothwell
0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2002-08-27 12:16 UTC (permalink / raw)
To: Jan Hudec; +Cc: bulb, bulb, linux-kernel
Hi Jan,
On Tue, 27 Aug 2002 10:42:44 +0200 Jan Hudec <bulb@cimice.maxinet.cz> wrote:
>
> One more question. Does the siginfo contain information weather is's
> read or write that the other process attempted? And does it contain the
No, you need to do fcntl(fd, F_GETLEASE) to find out what kind of
lease you need to set to satisfy the other process i.e. if the other
process does an open for reading then GETLEASE will return F_RDLCK
and if they attempt an open for writing the GETLEASE will return F_UNLCK.
> operation type for directory notifications?
No, sorry.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about leases
2002-08-27 4:44 ` Stephen Rothwell
@ 2002-09-02 11:29 ` Michael Kerrisk
0 siblings, 0 replies; 6+ messages in thread
From: Michael Kerrisk @ 2002-09-02 11:29 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: bulb, bulb, linux-kernel
> On Tue, 27 Aug 2002 14:35:17 +1000 Stephen Rothwell <sfr@canb.auug.org.au>
> wrote:
> >
> > On Tue, 27 Aug 2002 03:06:16 +0200 Jan Hudec <bulb@cimice.maxinet.cz>
> wrote:
> > >
> > > Please can anyone throw a bit light on file leases (fcntl F_SETLEASE
> > > command) or at least point me to some documentation? I can't find any.
> >
> > There isn't any (except maybe the talk I gave at Linux Kongress
> > last year (http://www.canb.auug.org.au/~sfr/idle.html).
Not quite true. I wrote some additions to the fcntl(2) manual page
describing leases. Download a recent copy of the man pages from tldp.org.
Cheers
Michael
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-09-02 11:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 1:06 Question about leases Jan Hudec
2002-08-27 4:35 ` Stephen Rothwell
2002-08-27 4:44 ` Stephen Rothwell
2002-09-02 11:29 ` Michael Kerrisk
2002-08-27 8:42 ` Jan Hudec
2002-08-27 12:16 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®