[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file
From: |
Bandan Das |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring |
Date: |
Mon, 09 Nov 2015 18:28:29 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Bandan Das <address@hidden> writes:
> Gerd Hoffmann <address@hidden> writes:
>
>> On Di, 2015-11-03 at 19:00 -0500, Bandan Das wrote:
>>> + /* Add a new watch asap so as to not lose events
>>> */
>>
>> This comment sounds like there is a race ("asap"). There isn't one,
>> correct ordering (adding the watch before reading the directory) is
>
> Hmm, seems like there's still a small window. We may not have even
> started processing the event because we are still processing the earlier
> ones.
>
>> enough to make sure you don't miss anything. You might see create
>> events for objects already in the tree though, are you prepared to
>> handle that?
>
> Oh, interesting. Current version will happily add duplicate entries.
> I will add a check.
By the way, did you mean this as a duplicate create event ?
I took a quick look at fs/notify/inotify_fsnotify.c:
int inotify_handle_event(...
ret = fsnotify_add_event(group, fsn_event, inotify_merge);
if (ret) {
/* Our event wasn't used in the end. Free it. */
fsnotify_destroy_event(group, fsn_event);
}
So, atleast for consecutive duplicate events, the kernel seems to be doing
some filtering of its own.
>> cheers,
>> Gerd
Re: [Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring, Gerd Hoffmann, 2015/11/05
[Qemu-devel] [PATCH 3/3] usb-mtp: add support for basic mtp events, Bandan Das, 2015/11/03