<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/notify/fsnotify.h, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-05-20T02:12:14Z</updated>
<entry>
<title>fsnotify: avoid spurious EMFILE errors from inotify_init()</title>
<updated>2016-05-20T02:12:14Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-05-20T00:08:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=35e481761cdc688dbee0ef552a13f49af8eba6cc'/>
<id>urn:sha1:35e481761cdc688dbee0ef552a13f49af8eba6cc</id>
<content type='text'>
Inotify instance is destroyed when all references to it are dropped.
That not only means that the corresponding file descriptor needs to be
closed but also that all corresponding instance marks are freed (as each
mark holds a reference to the inotify instance).  However marks are
freed only after SRCU period ends which can take some time and thus if
user rapidly creates and frees inotify instances, number of existing
inotify instances can exceed max_user_instances limit although from user
point of view there is always at most one existing instance.  Thus
inotify_init() returns EMFILE error which is hard to justify from user
point of view.  This problem is exposed by LTP inotify06 testcase on
some machines.

We fix the problem by making sure all group marks are properly freed
while destroying inotify instance.  We wait for SRCU period to end in
that path anyway since we have to make sure there is no event being
added to the instance while we are tearing down the instance.  So it
takes only some plumbing to allow for marks to be destroyed in that path
as well and not from a dedicated work item.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Reported-by: Xiaoguang Wang &lt;wangxg.fnst@cn.fujitsu.com&gt;
Tested-by: Xiaoguang Wang &lt;wangxg.fnst@cn.fujitsu.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fsnotify: remove mark-&gt;free_list</title>
<updated>2015-09-04T23:54:41Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2015-09-04T22:43:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=925d1132a03e33cb8f29a0057300d023b4f1be23'/>
<id>urn:sha1:925d1132a03e33cb8f29a0057300d023b4f1be23</id>
<content type='text'>
Free list is used when all marks on given inode / mount should be
destroyed when inode / mount is going away.  However we can free all of
the marks without using a special list with some care.

Signed-off-by: Jan Kara &lt;jack@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fsnotify: unify inode and mount marks handling</title>
<updated>2014-12-13T20:42:53Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2014-12-13T00:58:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0809ab69a2782afac8c4d7f3d35cd123050aab9a'/>
<id>urn:sha1:0809ab69a2782afac8c4d7f3d35cd123050aab9a</id>
<content type='text'>
There's a lot of common code in inode and mount marks handling.  Factor it
out to a common helper function.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Eric Paris &lt;eparis@redhat.com&gt;
Cc: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fanotify: fix notification of groups with inode &amp; mount marks</title>
<updated>2014-11-14T00:17:06Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2014-11-13T23:19:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8edc6e1688fc8f02c8c1f53a2ec4928cb1055f4d'/>
<id>urn:sha1:8edc6e1688fc8f02c8c1f53a2ec4928cb1055f4d</id>
<content type='text'>
fsnotify() needs to merge inode and mount marks lists when notifying
groups about events so that ignore masks from inode marks are reflected
in mount mark notifications and groups are notified in proper order
(according to priorities).

Currently the sorting of the lists done by fsnotify_add_inode_mark() /
fsnotify_add_vfsmount_mark() and fsnotify() differed which resulted
ignore masks not being used in some cases.

Fix the problem by always using the same comparison function when
sorting / merging the mark lists.

Thanks to Heinrich Schuchardt for improvements of my patch.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=87721
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Reported-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Tested-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fs/notify/group.c: make fsnotify_final_destroy_group() static</title>
<updated>2014-10-10T02:25:45Z</updated>
<author>
<name>Andrew Morton</name>
</author>
<published>2014-10-09T22:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cafbaae8afdb1e6cf9f4715aea2c897cf407ddfd'/>
<id>urn:sha1:cafbaae8afdb1e6cf9f4715aea2c897cf407ddfd</id>
<content type='text'>
No callers outside this file.

Cc: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fsnotify: remove global fsnotify groups lists</title>
<updated>2010-07-28T14:18:54Z</updated>
<author>
<name>Eric Paris</name>
</author>
<published>2010-07-28T14:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02436668d98385f5b5d9ffb695a37dadf98ed8a8'/>
<id>urn:sha1:02436668d98385f5b5d9ffb695a37dadf98ed8a8</id>
<content type='text'>
The global fsnotify groups lists were invented as a way to increase the
performance of fsnotify by shortcutting events which were not interesting.
With the changes to walk the object lists rather than global groups lists
these shortcuts are not useful.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
<entry>
<title>fsnotify: remove the global masks</title>
<updated>2010-07-28T14:18:54Z</updated>
<author>
<name>Eric Paris</name>
</author>
<published>2010-07-28T14:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=03930979afa63e079e9aefd4d3dd429240711027'/>
<id>urn:sha1:03930979afa63e079e9aefd4d3dd429240711027</id>
<content type='text'>
Because we walk the object-&gt;fsnotify_marks list instead of the global
fsnotify groups list we don't need the fsnotify_inode_mask and
fsnotify_vfsmount_mask as these were simply shortcuts in fsnotify() for
performance.  They are now extra checks, rip them out.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
<entry>
<title>fsnotify: srcu to protect read side of inode and vfsmount locks</title>
<updated>2010-07-28T14:18:52Z</updated>
<author>
<name>Eric Paris</name>
</author>
<published>2010-07-28T14:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75c1be487a690db43da2c1234fcacd84c982803c'/>
<id>urn:sha1:75c1be487a690db43da2c1234fcacd84c982803c</id>
<content type='text'>
Currently reading the inode-&gt;i_fsnotify_marks or
vfsmount-&gt;mnt_fsnotify_marks lists are protected by a spinlock on both the
read and the write side.  This patch protects the read side of those lists
with a new single srcu.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
<entry>
<title>fsnotify: allow marks to not pin inodes in core</title>
<updated>2010-07-28T13:58:59Z</updated>
<author>
<name>Eric Paris</name>
</author>
<published>2009-12-18T02:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=90b1e7a57880fb66437ab7db39e1e65ca0372822'/>
<id>urn:sha1:90b1e7a57880fb66437ab7db39e1e65ca0372822</id>
<content type='text'>
inotify marks must pin inodes in core.  dnotify doesn't technically need to
since they are closed when the directory is closed.  fanotify also need to
pin inodes in core as it works today.  But the next step is to introduce
the concept of 'ignored masks' which is actually a mask of events for an
inode of no interest.  I claim that these should be liberally sent to the
kernel and should not pin the inode in core.  If the inode is brought back
in the listener will get an event it may have thought excluded, but this is
not a serious situation and one any listener should deal with.

This patch lays the ground work for non-pinning inode marks by using lazy
inode pinning.  We do not pin a mark until it has a non-zero mask entry.  If a
listener new sets a mask we never pin the inode.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
<entry>
<title>fsnotify: Infrastructure for per-mount watches</title>
<updated>2010-07-28T13:58:57Z</updated>
<author>
<name>Andreas Gruenbacher</name>
</author>
<published>2009-12-18T02:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca9c726eea013394d1e846331b117effb21ead83'/>
<id>urn:sha1:ca9c726eea013394d1e846331b117effb21ead83</id>
<content type='text'>
Per-mount watches allow groups to listen to fsnotify events on an entire
mount.  This patch simply adds and initializes the fields needed in the
vfsmount struct to make this happen.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
</content>
</entry>
</feed>
