all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@hochschule-trier.de>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 26126@debbugs.gnu.org
Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches
Date: Sat, 25 Mar 2017 17:19:23 +0100	[thread overview]
Message-ID: <87shm1fhx0.fsf@luca> (raw)
In-Reply-To: <87a889jvvw.fsf@detlef> (Michael Albinus's message of "Sat, 25 Mar 2017 15:04:03 +0100")

[-- Attachment #1: Type: text/plain, Size: 2199 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:

> Andreas Politz <politza@hochschule-trier.de> writes:
>> + further simplify filenotify.el nor
>>
>> + handle differing masks in inotify.c .
>
> Thanks for this. Next time you provide a patch, could you pls merge
> emacs recent changes from master first? Your patch was rejected partly,
> and I had to apply rejected hunks manually. Comments:

Sorry, I forgot to pull.

Anyway, here is the more progressive version of the patch, adding both
of the above points.  (I guess, I'm to conservative sometimes and/or
seeing only problems everywhere.)

>> +;; * "inotify_add_watch adds a new watch, or modifies an existing watch"
>> +;;   We need to make sure that different watches for the same directory
>> +;;   don't set the mask in a conflicting way regarding changed/attribute-changed
>> +;; * Also check which other inotify flags are problematic
>> +;;   for concurrent use of the underlying descriptor
>
> Well, I had always the hope to modify inotify watches in this case. If
> there is a watch with flags f1, and a new watch for the same file is
> requested with flags f2, and f2 contains a flag which is not part of f1,
> then either the existing watch shall be adapted, or the existing watch
> shall be removed, and a new shall be installed. Don't know what's
> possible in inotify.

I implemented it by always using constantly watching for all events
(IN_ALL_EVENTS) and storing the given user-flags with the callback etc.
When an event occurs, I check whether it matches the given mask.

For that to work, I had to restrict the flag-usage by the user to those
not having an effect on the shared descriptor.

I also added IN_EXCL_UNLINK as a default.  This avoids reporting events
for already deleted filenames, which are still opened by some process,
which seems what we want as a default.  

> Your changes look good; "make -C test filenotify-tests
> SELECTOR='$(SELECTOR_DEFAULT)'" passes all tests. Even if there is room
> for improvement I believe you could push your patch to master now, in
> order to get feedback from other developers.

I ran the non-expensive tests for inotify, kqueue and they succeeded.

I have no push privileges.


[-- Attachment #2: Draft 3 --]
[-- Type: test/x-patch, Size: 37369 bytes --]

[-- Attachment #3: Type: text/plain, Size: 5 bytes --]


-ap

  reply	other threads:[~2017-03-25 16:19 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 14:14 bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches Andreas Politz
2017-03-17 14:41 ` Michael Albinus
2017-03-17 14:59   ` Andreas Politz
2017-03-17 16:08     ` Michael Albinus
2017-03-17 17:45       ` Andreas Politz
2017-03-18  8:30         ` Michael Albinus
2017-03-18 13:32           ` Andreas Politz
2017-03-18 19:36             ` Michael Albinus
2017-03-18 20:37               ` Andreas Politz
2017-03-19  9:39                 ` Michael Albinus
2017-03-19 11:14                   ` Andreas Politz
2017-03-19 19:23                     ` Michael Albinus
2017-03-20 20:39                       ` Andreas Politz
2017-03-21  8:44                         ` Michael Albinus
2017-03-21 15:37                           ` Eli Zaretskii
2017-03-21 18:59                             ` Andreas Politz
2017-03-22 13:23                             ` Michael Albinus
2017-03-22 15:44                               ` Eli Zaretskii
2017-03-22 16:01                                 ` Michael Albinus
2017-03-22 16:13                                   ` Eli Zaretskii
2017-03-22 16:23                                     ` Michael Albinus
2017-03-24 19:54                                 ` Andreas Politz
2017-03-25 12:50                                   ` Michael Albinus
2017-03-25 13:59                                     ` Andreas Politz
2017-03-25 14:08                                       ` Michael Albinus
2017-03-25 16:27                                         ` Andreas Politz
2017-03-25 16:37                                           ` Michael Albinus
2017-03-25 17:12                                             ` Andreas Politz
2017-03-25 18:36                                               ` Michael Albinus
2017-03-25 19:34                                                 ` Andreas Politz
2017-03-26  7:08                                                   ` Michael Albinus
2017-03-21 15:56                           ` Andreas Politz
2017-03-22 12:56                             ` Michael Albinus
2017-03-22 17:34                               ` Andreas Politz
2017-03-22 18:49                                 ` Michael Albinus
2017-03-19 22:05               ` Andreas Politz
2017-03-21 13:05                 ` Michael Albinus
2017-03-21 15:06                   ` Andreas Politz
2017-03-21 15:54                     ` Eli Zaretskii
2017-03-22 13:17                     ` Michael Albinus
2017-03-22 17:43                       ` Andreas Politz
2017-03-22 18:57                         ` Michael Albinus
2017-03-22 20:02                           ` Eli Zaretskii
2017-03-23  7:36                             ` Michael Albinus
2017-03-23 15:22                               ` Eli Zaretskii
2017-03-23 16:10                                 ` Michael Albinus
2017-03-22 19:40                   ` Michael Albinus
2017-03-24 20:44                 ` Andreas Politz
2017-03-25  6:35                   ` Eli Zaretskii
2017-03-25  8:57                     ` Andreas Politz
2017-03-25 14:17                       ` Eli Zaretskii
2017-03-25 16:34                         ` Andreas Politz
2017-03-25 14:04                   ` Michael Albinus
2017-03-25 16:19                     ` Andreas Politz [this message]
2017-03-25 17:09                       ` Michael Albinus
2017-03-25 17:26                         ` Andreas Politz
2017-03-25 18:18                         ` Andreas Politz
2017-03-25 18:40                           ` Michael Albinus
2017-03-25 16:21                     ` Andreas Politz
2017-03-18 19:28           ` Andreas Politz
2017-03-18 19:49             ` Michael Albinus
2017-03-18 20:48               ` Andreas Politz
2017-03-30 18:15 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shm1fhx0.fsf@luca \
    --to=politza@hochschule-trier.de \
    --cc=26126@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.