mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* dnotify semantics
@ 2001-10-26 15:48 Alex Larsson
  2001-10-26 18:16 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Larsson @ 2001-10-26 15:48 UTC (permalink / raw)
  To: linux-kernel

Currently when monitoring a directory using dnotify you get notifications 
whenever some file in the directory changes, or is added/removed. But when 
the directory itself is changed (i.e. chmoded) you don't get any notification.

Reading Documentation/dnotify.txt it does not seem clear what the expected 
behaviour is, it says:

 The intention of directory notification is to allow user applications
 to be notified when a directory, or any of the files in it, are changed.

But then:

        DN_ACCESS       A file in the directory was accessed (read)
        DN_MODIFY       A file in the directory was modified (write,truncate)
        DN_CREATE       A file was created in the directory
        DN_DELETE       A file was unlinked from directory
        DN_RENAME       A file in the directory was renamed
        DN_ATTRIB       A file in the directory had its attributes
                        changed (chmod,chown)

 (i.e. no directory was changed event)

This is somewhat of a problem for me, implementing fam using dnotify. When 
monitoring a directory i need to send events also when the directory 
changes. The only way this can be done with the current semantics would be 
to monitor both the directory and it's parent. Unfortunately this could
create many spurious events/stats, and is not possible to do for the root 
directory.

Is there any chance that we can get a change in semantics so that changes 
to the directory itself also causes a notification?

/ Alex

(Please CC me, I'm not on the linux-kernel list)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dnotify semantics
  2001-10-26 15:48 dnotify semantics Alex Larsson
@ 2001-10-26 18:16 ` Andreas Dilger
  2001-10-26 18:31   ` Andreas Ferber
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2001-10-26 18:16 UTC (permalink / raw)
  To: Alex Larsson; +Cc: linux-kernel

On Oct 26, 2001  11:48 -0400, Alex Larsson wrote:
> Currently when monitoring a directory using dnotify you get notifications 
> whenever some file in the directory changes, or is added/removed. But when 
> the directory itself is changed (i.e. chmoded) you don't get any notification.

So, monitor the parent of the directory in question for attribute changes.

Cheers, Andreas
--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dnotify semantics
  2001-10-26 18:16 ` Andreas Dilger
@ 2001-10-26 18:31   ` Andreas Ferber
  2001-10-26 18:56     ` Alex Larsson
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Ferber @ 2001-10-26 18:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alex Larsson

On Fri, Oct 26, 2001 at 12:16:28PM -0600, Andreas Dilger wrote:

> So, monitor the parent of the directory in question for attribute changes.

... which is a little bit difficult if you want to monitor the root
directory.

Andreas
-- 
       Andreas Ferber - dev/consulting GmbH - Bielefeld, FRG
     ---------------------------------------------------------
         +49 521 1365800 - af@devcon.net - www.devcon.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: dnotify semantics
  2001-10-26 18:31   ` Andreas Ferber
@ 2001-10-26 18:56     ` Alex Larsson
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Larsson @ 2001-10-26 18:56 UTC (permalink / raw)
  To: Andreas Ferber; +Cc: linux-kernel

On Fri, 26 Oct 2001, Andreas Ferber wrote:

> On Fri, Oct 26, 2001 at 12:16:28PM -0600, Andreas Dilger wrote:
> 
> > So, monitor the parent of the directory in question for attribute changes.
> 
> ... which is a little bit difficult if you want to monitor the root
> directory.

Which is what i said in my mail, if you read it.

It also adds a monitor to a possibly busy directory that could cause a lot 
of spurious events and corresponding stats.

/ Alex


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-10-26 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-26 15:48 dnotify semantics Alex Larsson
2001-10-26 18:16 ` Andreas Dilger
2001-10-26 18:31   ` Andreas Ferber
2001-10-26 18:56     ` Alex Larsson

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®