* inotify and IN_UNMOUNT-events
@ 2005-08-30 19:46 Juergen Quade
2005-08-31 3:33 ` Robert Love
0 siblings, 1 reply; 4+ messages in thread
From: Juergen Quade @ 2005-08-30 19:46 UTC (permalink / raw)
To: linux-kernel
Playing around with inotify I have some problems
to generate/receive IN_UNMOUNT-events (using
a self written application and inotify_utils-0.25;
kernel 2.6.13).
Doing:
- mount /dev/hda1 /mnt
- add a watch to the path /mnt/ ("./inotify_test /mnt")
- umount /mnt
results in two events:
1. IN_DELETE_SELF (mask=0x0400)
2. IN_IGNORED (mask=0x8000)
Any ideas?
Juergen.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: inotify and IN_UNMOUNT-events
2005-08-30 19:46 inotify and IN_UNMOUNT-events Juergen Quade
@ 2005-08-31 3:33 ` Robert Love
2005-08-31 3:44 ` Kyle Moffett
2005-08-31 7:01 ` Juergen Quade
0 siblings, 2 replies; 4+ messages in thread
From: Robert Love @ 2005-08-31 3:33 UTC (permalink / raw)
To: Juergen Quade; +Cc: linux-kernel
On Tue, 2005-08-30 at 21:46 +0200, Juergen Quade wrote:
> Playing around with inotify I have some problems
> to generate/receive IN_UNMOUNT-events (using
> a self written application and inotify_utils-0.25;
> kernel 2.6.13).
>
> Doing:
> - mount /dev/hda1 /mnt
> - add a watch to the path /mnt/ ("./inotify_test /mnt")
> - umount /mnt
>
> results in two events:
> 1. IN_DELETE_SELF (mask=0x0400)
> 2. IN_IGNORED (mask=0x8000)
>
> Any ideas?
"/mnt" is not unmounted, stuff inside of it is.
Watch, say, "/mnt/foo/bar" and when /dev/hda1 is unmounted, you will get
an IN_UNMOUNT on the watch.
Robert Love
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: inotify and IN_UNMOUNT-events
2005-08-31 3:33 ` Robert Love
@ 2005-08-31 3:44 ` Kyle Moffett
2005-08-31 7:01 ` Juergen Quade
1 sibling, 0 replies; 4+ messages in thread
From: Kyle Moffett @ 2005-08-31 3:44 UTC (permalink / raw)
To: Robert Love; +Cc: Juergen Quade, linux-kernel
On Aug 30, 2005, at 23:33:27, Robert Love wrote:
> On Tue, 2005-08-30 at 21:46 +0200, Juergen Quade wrote:
>
>> Playing around with inotify I have some problems
>> to generate/receive IN_UNMOUNT-events (using
>> a self written application and inotify_utils-0.25;
>> kernel 2.6.13).
>>
>> Doing:
>> - mount /dev/hda1 /mnt
>> - add a watch to the path /mnt/ ("./inotify_test /mnt")
>> - umount /mnt
>>
>> results in two events:
>> 1. IN_DELETE_SELF (mask=0x0400)
>> 2. IN_IGNORED (mask=0x8000)
>>
>> Any ideas?
>
> "/mnt" is not unmounted, stuff inside of it is.
>
> Watch, say, "/mnt/foo/bar" and when /dev/hda1 is unmounted, you
> will get
> an IN_UNMOUNT on the watch.
I think this might work as well:
# mount /dev/hda1 /mnt
# ./inotify_test /mnt/. &
# umount /mnt
That should get the effect you are looking for
Cheers,
Kyle Moffett
--
I have yet to see any problem, however complicated, which, when you
looked at
it in the right way, did not become still more complicated.
-- Poul Anderson
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: inotify and IN_UNMOUNT-events
2005-08-31 3:33 ` Robert Love
2005-08-31 3:44 ` Kyle Moffett
@ 2005-08-31 7:01 ` Juergen Quade
1 sibling, 0 replies; 4+ messages in thread
From: Juergen Quade @ 2005-08-31 7:01 UTC (permalink / raw)
To: Robert Love; +Cc: linux-kernel, Kyle Moffett
> > ...
> > results in two events:
> > 1. IN_DELETE_SELF (mask=0x0400)
> > 2. IN_IGNORED (mask=0x8000)
> >
> > Any ideas?
>
> "/mnt" is not unmounted, stuff inside of it is.
>
> Watch, say, "/mnt/foo/bar" and when /dev/hda1 is unmounted, you will get
> an IN_UNMOUNT on the watch.
I tried that too. Seems not to work (at least for me):
root@mobil:/tmp/inotify-utils-0.25 # mount /dev/hda6 /mnt
root@mobil:/tmp/inotify-utils-0.25 # ls /mnt/foo/bar
/mnt/foo/bar
root@mobil:/tmp/inotify-utils-0.25 # ./inotify_test /mnt/foo/bar &
inotify device fd = 3
/mnt/foo/bar WD=1
[1] 8454
root@mobil:/tmp/inotify-utils-0.25 # umount /dev/hda6
read = 32
sizeof inotify_event = 16
pevent->len = 0
pevent->len = 0
EVENT ON WD=1
DELETE_SELF (file) 0x00000400
EVENT ON WD=1
IGNORED (file) 0x00008000
root@mobil:/tmp/inotify-utils-0.25 #
Juergen.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-08-31 7:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-30 19:46 inotify and IN_UNMOUNT-events Juergen Quade
2005-08-31 3:33 ` Robert Love
2005-08-31 3:44 ` Kyle Moffett
2005-08-31 7:01 ` Juergen Quade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox