2008-01-22 20:26:26

by devzero-S0/GAf8tV78

[permalink] [raw]
Subject: inotify and nfsd exported filesystem

hello !

it seems that accessing a file via knfsd exported filesystem doesn`t create an appropriate event with inotify-tools, i.e. i cannot "see" that this file has been accessed.
no problems if acess that file on the same machine via userspace - but accessing from a remote box via nfs just fails.

can somebody confirm this issue?

is this by design or is this a bug?

regards
roland
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066



2008-01-22 20:29:17

by J. Bruce Fields

[permalink] [raw]
Subject: Re: inotify and nfsd exported filesystem

On Tue, Jan 22, 2008 at 09:26:24PM +0100, devzero-S0/[email protected] wrote:
> hello !
>
> it seems that accessing a file via knfsd exported filesystem doesn`t
> create an appropriate event with inotify-tools, i.e. i cannot "see"
> that this file has been accessed.

What do you mean by "accessing"--is it just reads that are missed?
Writes as well? Other kinds of modications of the filesystem?

--b.

> no problems if acess that file on the same machine via userspace - but
> accessing from a remote box via nfs just fails.
>
> can somebody confirm this issue?
>
> is this by design or is this a bug?

2008-01-22 20:36:59

by devzero-S0/GAf8tV78

[permalink] [raw]
Subject: Re: inotify and nfsd exported filesystem

i was only testing for IN_OPEN and IN_CLOSE_NOWRITE ( http://inotify-t=
ools.sourceforge.net/api/inotifytools_8h.html )

can do more in depth test tomorrow.


> -----Urspr=FCngliche Nachricht-----
> Von: "J. Bruce Fields" <[email protected]>
> Gesendet: 22.01.08 21:29:42
> An: devzero-S0/[email protected]
> CC: [email protected]
> Betreff: Re: inotify and nfsd exported filesystem


>=20
> On Tue, Jan 22, 2008 at 09:26:24PM +0100, devzero-S0/[email protected] wrote:
> > hello !
> >=20
> > it seems that accessing a file via knfsd exported filesystem doesn`=
t
> > create an appropriate event with inotify-tools, i.e. i cannot "see"
> > that this file has been accessed.
>=20
> What do you mean by "accessing"--is it just reads that are missed?
> Writes as well? Other kinds of modications of the filesystem?
>=20
> --b.
>=20
> > no problems if acess that file on the same machine via userspace - =
but
> > accessing from a remote box via nfs just fails.
> >=20
> > can somebody confirm this issue?
> >=20
> > is this by design or is this a bug?
>=20


_______________________________________________________________________=
__
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten=
!=20
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=3D021114


2008-01-22 20:40:06

by J. Bruce Fields

[permalink] [raw]
Subject: Re: inotify and nfsd exported filesystem

On Tue, Jan 22, 2008 at 09:36:57PM +0100, devzero-S0/[email protected] wrote:
> i was only testing for IN_OPEN and IN_CLOSE_NOWRITE ( http://inotify=
-tools.sourceforge.net/api/inotifytools_8h.html )

Something like CLOSE_NOWRITE is not in general going to be reliable,
because, for obvious performance reasons, the client doesn't necessaril=
y
always tell the server every time an application opens or closes a file=
=2E

> can do more in depth test tomorrow.

Thanks.

--b.

>=20
>=20
> > -----Urspr=C3=BCngliche Nachricht-----
> > Von: "J. Bruce Fields" <[email protected]>
> > Gesendet: 22.01.08 21:29:42
> > An: devzero-S0/[email protected]
> > CC: [email protected]
> > Betreff: Re: inotify and nfsd exported filesystem
>=20
>=20
> >=20
> > On Tue, Jan 22, 2008 at 09:26:24PM +0100, devzero-S0/[email protected] wrote:
> > > hello !
> > >=20
> > > it seems that accessing a file via knfsd exported filesystem does=
n`t
> > > create an appropriate event with inotify-tools, i.e. i cannot "se=
e"
> > > that this file has been accessed.
> >=20
> > What do you mean by "accessing"--is it just reads that are missed?
> > Writes as well? Other kinds of modications of the filesystem?
> >=20
> > --b.
> >=20
> > > no problems if acess that file on the same machine via userspace =
- but
> > > accessing from a remote box via nfs just fails.
> > >=20
> > > can somebody confirm this issue?
> > >=20
> > > is this by design or is this a bug?
> >=20
>=20
>=20
> _____________________________________________________________________=
____
> In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalt=
en!=20
> Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=3D021114
>=20

2008-01-22 21:34:09

by NeilBrown

[permalink] [raw]
Subject: Re: inotify and nfsd exported filesystem

On Tuesday January 22, devzero-S0/[email protected] wrote:
> i was only testing for IN_OPEN and IN_CLOSE_NOWRITE ( http://inotify-tools.sourceforge.net/api/inotifytools_8h.html )
>
> can do more in depth test tomorrow.

If you are watching for inotify events on the server, and performing
accesses on some client, then I would expect you to get an IN_OPEN
followed immediately by an IN_CLOSE_{NO,}WRITE each time the client
sends a READ or WRITE request respectively.

So if the client just opens the file and then closes it, you would get
no INOTIFY events.
If the client performs open/read/close repeatedly, subsequent reads
would come from cache, so you would only get one
IN_OPEN/IN_CLOSE_NOWRITE
pair.

If the client performs writes, you should get a more predictable
stream of IN_OPEN/IN_CLOSE_WRITE pairs, though they could be delayed a
bit.

You results will probably be different (and possible more like what
you expect) if you use NFSv4.

NeilBrown

2008-01-22 21:39:38

by J. Bruce Fields

[permalink] [raw]
Subject: Re: inotify and nfsd exported filesystem

On Wed, Jan 23, 2008 at 08:34:01AM +1100, Neil Brown wrote:
> On Tuesday January 22, devzero-S0/[email protected] wrote:
> > i was only testing for IN_OPEN and IN_CLOSE_NOWRITE ( http://inotify-tools.sourceforge.net/api/inotifytools_8h.html )
> >
> > can do more in depth test tomorrow.
>
> If you are watching for inotify events on the server, and performing
> accesses on some client, then I would expect you to get an IN_OPEN
> followed immediately by an IN_CLOSE_{NO,}WRITE each time the client
> sends a READ or WRITE request respectively.
>
> So if the client just opens the file and then closes it, you would get
> no INOTIFY events.
> If the client performs open/read/close repeatedly, subsequent reads
> would come from cache, so you would only get one
> IN_OPEN/IN_CLOSE_NOWRITE
> pair.
>
> If the client performs writes, you should get a more predictable
> stream of IN_OPEN/IN_CLOSE_WRITE pairs, though they could be delayed a
> bit.
>
> You results will probably be different (and possible more like what
> you expect) if you use NFSv4.

Until delegations are granted, and then you'll start missing some of the
client's opens again....

I'd expect inotify to notice changes to directories and (after some
delay) to file data, but wouldn't count on more than that.

--b.