Christian Borntraeger e3a2a0d4e5 anon_inodes: use fops->owner for module refcount
There is an imbalance for anonymous inodes. If the fops->owner field is set,
the module reference count of owner is decreases on release.
("filp_close" --> "__fput" ---> "fops_put")

On the other hand, anon_inode_getfd does not increase the module reference
count of owner. This causes two problems:

- if owner is set, the module refcount goes negative
- if owner is not set, the module can be unloaded while code is running

This patch changes anon_inode_getfd to be symmetric regarding fops->owner
handling.

I have checked all existing users of anon_inode_getfd. Noone sets fops->owner,
thats why nobody has seen the module refcount negative. The refcounting was
tested with a patched and unpatched KVM module.(see patch 2/2) I also did an
epoll_open/close test.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31 16:55:44 +02:00
..
2008-12-25 11:40:09 +11:00
2008-10-31 00:56:28 -07:00
2008-11-14 11:29:12 +11:00
2008-11-20 08:11:52 +11:00
2008-08-20 15:40:32 -07:00
2008-10-13 09:47:43 +11:00
2008-11-25 16:51:45 -08:00
2008-12-04 17:16:36 +11:00
2008-11-14 11:29:12 +11:00
2008-12-29 08:29:51 +01:00
2008-11-14 11:29:12 +11:00
2008-04-29 08:06:00 -07:00
2008-11-14 10:39:25 +11:00
2008-12-30 16:51:43 -05:00
2008-12-30 16:51:43 -05:00
2008-12-30 16:51:43 -05:00
2008-10-17 02:38:36 +11:00
2008-12-01 19:55:25 -08:00
2008-11-18 15:08:56 +01:00
2008-12-04 17:16:36 +11:00
2008-12-04 17:16:36 +11:00
2008-12-29 16:47:18 +11:00
2008-12-29 08:29:50 +01:00
2008-12-29 08:29:53 +01:00
2008-12-04 04:22:57 -05:00
2008-10-23 05:12:59 -04:00
2008-01-30 13:31:46 +01:00
2008-05-01 13:08:16 -04:00
2008-12-25 11:40:09 +11:00
2008-11-14 10:39:25 +11:00
2008-10-30 11:38:45 -07:00
2008-12-04 17:16:36 +11:00
2008-11-14 11:29:12 +11:00
2008-11-20 08:11:55 +11:00
2008-11-14 10:39:23 +11:00
2008-10-30 11:38:45 -07:00