This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] BZ #14906: Enhance nscd's inotify support.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Fri, 13 Mar 2015 11:11:38 -0400
- Subject: Re: [PATCH] BZ #14906: Enhance nscd's inotify support.
- Authentication-results: sourceware.org; auth=none
- References: <54E42FA6 dot 8010500 at redhat dot com> <54E60723 dot 6000309 at redhat dot com>
On 02/19/2015 10:54 AM, Carlos O'Donell wrote:
> On 02/18/2015 01:22 AM, Carlos O'Donell wrote:
>> Tested extensively, though manually, on x86_64 with no regressions and no
>> problems detected. Underscores the need for a better testing framework than
>> what we have.
> If nobody objects I'll check this in next week.
> During kernel testing I tested on a 2.6.32 kernel and discovered that
> the file removal and creation notification events are out of order.
> This requires a stat-based check in inotify_check_files() to double-check
> if the file is present, if it is, then the move/delete/unregister event
> is ignored and the file continues to be monitored. If we lost an event
> the stat check during pruning will detect the file change.
> - Use stat to double check a move/delete/unregister event.
Author: Carlos O'Donell <email@example.com>
Date: Fri Mar 13 09:49:24 2015 -0400
Enhance nscd's inotify support (Bug 14906).
In bug 14906 the user complains that the inotify support in nscd
is not sufficient when it comes to detecting changes in the
configurationfiles that should be watched for the various databases.
The current nscd implementation uses inotify to watch for changes in
the configuration files, but adds watches only for IN_DELETE_SELF and
IN_MODIFY. These watches are insufficient to cover even the most basic
uses by a system administrator. For example using emacs or vim to edit
a configuration file should trigger a reload but it might not if
the editors use move to atomically update the file. This atomic update
changes the inode and thus removes the notification on the file (as
inotify is based on inodes). Thus the inotify support in nscd for
configuration files is insufficient to account for the average use
cases of system administrators and users.
The inotify support is significantly enhanced and described here:
Tested on x86_64 with and without inotify support.