Re: [PATCH] [RFC] fsnotify: Tell the user what part of the file mighthave changed

From: Alexey Zaytsev
Date: Tue Nov 16 2010 - 07:37:45 EST


On Tue, Nov 16, 2010 at 15:25, Jan Kara <jack@xxxxxxx> wrote:
> ÂHello,
>
> On Mon 15-11-10 00:44:08, Alexey Zaytsev wrote:
>> Signed-off-by: Alexey Zaytsev <alexey.zaytsev@xxxxxxxxx>
>> ---
>>
>> Hi.
>>
>> The patch adds fschange-like [1] modification ranges to
>> fsnotify events. Fanotify is made to pass the range
>> to the users.
> ÂWhat I always found a bit awkward about inotify/fanotify is that you get
> no notification if the file modification happens via mmap(). For backup
> programs this is certainly unacceptable so you have to track open events
> and check mtime anyway because of this.
>
> We could start sending MODIFY events when writeable mmap happens (IMHO a
> sensible thing to do) but with ranges you have to watch out to send a
> range like 0..((1<<64)-1) to accommodate future file changes.
>
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂHonza

Actually, it should be possible to monitor the mmaps. Not individual
writes, of course, but you should be able to get the write-mapped
range from close_write. Have not implemented this in the first
version, but it's possible to do. By the way, splice also is not
handled by fsnotify yet. Not sure, are there any other ways to modify
a file?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/