All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: "Joseph D. Wagner" <theman@josephdwagner.info>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: File and Directory Change Notification
Date: Wed, 26 Nov 2003 04:15:48 +0000	[thread overview]
Message-ID: <20031126041548.GA10853@mail.shareable.org> (raw)
In-Reply-To: <200311252053.47193.theman@josephdwagner.info>

Joseph D. Wagner wrote:
> The docs are a little sketchy on this one.
> 
> Using fcntl(), can you get change notifications on specific files, or just 
> directories?

You can use F_NOTIFY to get notifications of all files in a directory
(the whole directory, and only for operations via this path in case of
hard links), and F_SETLEASE to get notifications of other processes
opening a file.

There's no way to be notified of every individual write to a single
file, but that isn't typically useful anyway.

What's missing from leases is the ability to block until the final
close of a file (and block further opens in the meantime), and for
F_RDLCK leases to fail/block when the file is open for writing
(there's a FIXME in the kernel lease code for that, but nobody has
fixed it).

I'm not sure why exclusive leases are always allowed but mandatory
locking isn't by default.  They seem to offer similar DOS possibilities.

-- Jamie

  reply	other threads:[~2003-11-26  4:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25 14:53 File and Directory Change Notification Joseph D. Wagner
2003-11-26  4:15 ` Jamie Lokier [this message]
2003-11-25 16:38   ` Joseph D. Wagner
2003-11-26  4:57     ` Jamie Lokier
2003-11-25 18:01       ` Joseph D. Wagner
2003-11-26 12:38         ` Matthew Wilcox
2003-11-26 12:37   ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031126041548.GA10853@mail.shareable.org \
    --to=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=theman@josephdwagner.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.