Re: Inotify fails to send IN_ATTRIB events

2007-11-23 Thread Morten Welinder
This looks bad, though:

include/linux/fsnotify.h:121: warning: passing argument 2 of
'audit_inode_child' from incompatible pointer type

Missing "->d_inode"?

M.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Inotify fails to send IN_ATTRIB events

2007-11-23 Thread Morten Welinder
> With this patch I am seeing a endless stream of  IN_IGNORED events
> for a removed watch.

Sorry, that problem was on the chair. side of the keyboard -- too much
turkey, I fear. It just happened to be easier to trigger with the patch's
double event on deletion.

I'd still love to see ENOSYS when inotify can't handle a given virtual
file.

I'm not sure "signed-off-by" if appropriate for me, but at least...

Acked-by: Morten Welinder <[EMAIL PROTECTED]>

Morten
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Inotify fails to send IN_ATTRIB events

2007-11-23 Thread Morten Welinder
This looks bad, though:

include/linux/fsnotify.h:121: warning: passing argument 2 of
'audit_inode_child' from incompatible pointer type

Missing -d_inode?

M.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Inotify fails to send IN_ATTRIB events

2007-11-23 Thread Morten Welinder
 With this patch I am seeing a endless stream of  IN_IGNORED events
 for a removed watch.

Sorry, that problem was on the chair. side of the keyboard -- too much
turkey, I fear. It just happened to be easier to trigger with the patch's
double event on deletion.

I'd still love to see ENOSYS when inotify can't handle a given virtual
file.

I'm not sure signed-off-by if appropriate for me, but at least...

Acked-by: Morten Welinder [EMAIL PROTECTED]

Morten
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Inotify fails to send IN_ATTRIB events

2007-11-22 Thread Morten Welinder
> Wanna try the patch below?

With this patch I am seeing a endless stream of  IN_IGNORED events
for a removed watch.  I don't see a reason that user space should
ever see any IN_IGNORED, but an endless steam is not good.

Utterly unrelated, inotify does not work in /proc/.  The list archives
suggest that it isn't likely to start working anytime soon, but shouldn't
inotify_add_watch when fail with ENOSYS instead of pretending
it worked?

Morten




Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 1 with mask 0x07c0 for /home/welinder
# "touch hi" here
Got event 0100 for 1
Created inotify watch 2 with mask 0x0fc6 for /home/welinder/hi
Removing notify watch 1
Got event 8000 for 1
Got event 0004 for 2
# "rm hi" here
Got event 0400 for 2
Removing notify watch 2
Got event 8000 for 2
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 3 with mask 0x07c0 for /home/welinder
Got event 0200 for 3
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 3 with mask 0x07c0 for /home/welinder
# "touch hi" here
Got event 0100 for 3
Created inotify watch 4 with mask 0x0fc6 for /home/welinder/hi
Removing notify watch 3
Got event 8000 for 3
Got event 0004 for 4
Got event 0004 for 4
# "rm hi" here
Got event 0400 for 4
Removing notify watch 4
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 5 with mask 0x07c0 for /home/welinder
Got event 8000 for 4
Got event 8000 for 4
Got event 8000 for 4
Got event 8000 for 4
...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Inotify fails to send IN_ATTRIB events

2007-11-22 Thread Morten Welinder
 Wanna try the patch below?

With this patch I am seeing a endless stream of  IN_IGNORED events
for a removed watch.  I don't see a reason that user space should
ever see any IN_IGNORED, but an endless steam is not good.

Utterly unrelated, inotify does not work in /proc/.  The list archives
suggest that it isn't likely to start working anytime soon, but shouldn't
inotify_add_watch when fail with ENOSYS instead of pretending
it worked?

Morten




Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 1 with mask 0x07c0 for /home/welinder
# touch hi here
Got event 0100 for 1
Created inotify watch 2 with mask 0x0fc6 for /home/welinder/hi
Removing notify watch 1
Got event 8000 for 1
Got event 0004 for 2
# rm hi here
Got event 0400 for 2
Removing notify watch 2
Got event 8000 for 2
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 3 with mask 0x07c0 for /home/welinder
Got event 0200 for 3
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 3 with mask 0x07c0 for /home/welinder
# touch hi here
Got event 0100 for 3
Created inotify watch 4 with mask 0x0fc6 for /home/welinder/hi
Removing notify watch 3
Got event 8000 for 3
Got event 0004 for 4
Got event 0004 for 4
# rm hi here
Got event 0400 for 4
Removing notify watch 4
Failed to create inotify watch for /home/welinder/hi: No such file or directory
Created inotify watch 5 with mask 0x07c0 for /home/welinder
Got event 8000 for 4
Got event 8000 for 4
Got event 8000 for 4
Got event 8000 for 4
...
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Inotify fails to send IN_ATTRIB events

2007-11-20 Thread Morten Welinder
I am seeing missing inotify IN_ATTRIB events in the following situation:

1. "touch foo"

2. Make inotify watch "foo"

3. "ln foo bar"
   --> Link count changed so I should have gotten an IN_ATTRIB.

4. "rm foo"
   --> Link count changed so I should have gotten an IN_ATTRIB.  (Or
IN_DELETE_SELF;
   I don't care which.)

5. "ln bar foo && rm bar"
   --> Still no events.

6. "mv foo bar"
   --> I get IN_MOVED_SELF.  Good!

7. "mv bar foo"
   --> I get IN_MOVED_SELF.  Good!


3+4 is pretty much the same as 6, so I really ought to be told that my
file has changed
name.  I don't really care much about getting notified about 3, but
for completeness
it ought to be handled.

As far as I can see, the only way to be told about 4 is to put a watch
on the directory in
which foo resides.  That is inelegant and has an inherent race condition.

This is with "Linux version 2.6.22.12-0.1-default" (SuSE 10.3)

Looking at current source, fs/namei.c, I notice that vfs_rename has a
fsnotify_move call
(which notified directory as well as files) whereas sys_link only has
a fsnotify_create call
(which notified the directory only).

Morten
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Inotify fails to send IN_ATTRIB events

2007-11-20 Thread Morten Welinder
I am seeing missing inotify IN_ATTRIB events in the following situation:

1. touch foo

2. Make inotify watch foo

3. ln foo bar
   -- Link count changed so I should have gotten an IN_ATTRIB.

4. rm foo
   -- Link count changed so I should have gotten an IN_ATTRIB.  (Or
IN_DELETE_SELF;
   I don't care which.)

5. ln bar foo  rm bar
   -- Still no events.

6. mv foo bar
   -- I get IN_MOVED_SELF.  Good!

7. mv bar foo
   -- I get IN_MOVED_SELF.  Good!


3+4 is pretty much the same as 6, so I really ought to be told that my
file has changed
name.  I don't really care much about getting notified about 3, but
for completeness
it ought to be handled.

As far as I can see, the only way to be told about 4 is to put a watch
on the directory in
which foo resides.  That is inelegant and has an inherent race condition.

This is with Linux version 2.6.22.12-0.1-default (SuSE 10.3)

Looking at current source, fs/namei.c, I notice that vfs_rename has a
fsnotify_move call
(which notified directory as well as files) whereas sys_link only has
a fsnotify_create call
(which notified the directory only).

Morten
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: idio{,ma}tic typos (was Re: + fix-vm_can_nonlinear-check-in-sys_remap_file_pages.patch added to -mm tree)

2007-10-10 Thread Morten Welinder
> While we're at it, below is somewhat ugly sparse patch for detecting
> "&& 0x" typos.

Excellent idea, and there is something to be said about a low-footprint patch
like that.  However, if you really want to capture this kind of bugs, you would
need to have some kind "not a boolean" or "bitfield" attribute that
can propagate.
For example, you would want

if (foo && (BAR | BAZ)) ...;

with BAR and BAZ being hex constants to produce the same warning.

Incidentally, it is probably not just hex constants that deserve this treatment:
octal constants and variations of (1 << cst) are of the same nature.  As well
as enums defined in such manners.

Morten
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: idio{,ma}tic typos (was Re: + fix-vm_can_nonlinear-check-in-sys_remap_file_pages.patch added to -mm tree)

2007-10-10 Thread Morten Welinder
 While we're at it, below is somewhat ugly sparse patch for detecting
  0x typos.

Excellent idea, and there is something to be said about a low-footprint patch
like that.  However, if you really want to capture this kind of bugs, you would
need to have some kind not a boolean or bitfield attribute that
can propagate.
For example, you would want

if (foo  (BAR | BAZ)) ...;

with BAR and BAZ being hex constants to produce the same warning.

Incidentally, it is probably not just hex constants that deserve this treatment:
octal constants and variations of (1  cst) are of the same nature.  As well
as enums defined in such manners.

Morten
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/