[systemd-devel] [PATCH 2/2] path: do not watch IN_ATTRIB for parent directories

Michal Schmidt mschmidt at redhat.com
Wed Dec 1 07:41:28 PST 2010


On Wed, 1 Dec 2010 16:31:20 +0100 Kay Sievers wrote:
> On Wed, Dec 1, 2010 at 16:05, Michal Schmidt wrote:
> > I think it's this way in order to simulate a strict path-based
> > watch, as opposed to an inode-based one.
> > For cases when someone recreates the directory hierarchy in a weird
> > way, like:
> >  # a watch is set on /foo/bar/baz
> >  mv /foo/bar /foo/qux
> >  mkdir -p /foo/bar/baz  # a completely NEW /foo/bar/baz inode
> 
> That should probably be avoided for DirectoryNotEmpty=.

I guess Lennart wanted it to work even in cases when the directory to
be watched is created later.

> Nothing should watch /dev just for that reason.

If the watch were only for IN_DELETE_SELF|IN_MOVE_SELF, it wouldn't be
too bad. These events are rare.

Michal


More information about the systemd-devel mailing list