android_kernel_asus_sm8350/fs/notify
Eric Paris b31d397e43 fsnotify: call iput on inodes when no longer marked
fsnotify takes an igrab on an inode when it adds a mark.  The code was
supposed to drop the reference when the mark was removed but didn't.
This caused problems when an fs was unmounted because those inodes would
clearly not be gone.  Thus resulting in the most devistating of messages:

VFS: Busy inodes after unmount of loop0. Self-destruct in 5 seconds.
>>> Have a nice day...

Jiri Slaby bisected the problem to a patch in the fsnotify tree.  The
code snippets below show my stupidity quite clearly.

void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark)
{
	...
	mark->inode = NULL;
	...
}

void fsnotify_destroy_mark(struct fsnotify_mark *mark)
{
	struct inode *inode = NULL;
	...
	if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
		fsnotify_destroy_inode_mark(mark);
		inode = mark->i.inode;
	}
	...
	if (inode)
		iput(inode);
	...
}

Obviously the intent was to capture the inode before it was set to NULL in
fsnotify_destory_inode_mark() so we wouldn't be leaking inodes forever.
Instead we leaked them (and exploded on umount)

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
2010-07-28 09:59:02 -04:00
..
dnotify fsnotify: allow marks to not pin inodes in core 2010-07-28 09:58:59 -04:00
fanotify fanotify: do not return 0 in a void function 2010-07-28 09:59:02 -04:00
inotify fsnotify: intoduce a notification merge argument 2010-07-28 09:59:01 -04:00
fsnotify.c fanotify: do not always return 0 in fsnotify 2010-07-28 09:59:02 -04:00
fsnotify.h fsnotify: allow marks to not pin inodes in core 2010-07-28 09:58:59 -04:00
group.c fsnotify: add group priorities 2010-07-28 09:59:01 -04:00
inode_mark.c fanotify: clear all fanotify marks 2010-07-28 09:59:00 -04:00
Kconfig fanotify: fscking all notification system 2010-07-28 09:58:54 -04:00
Makefile fsnotify: vfsmount marks generic functions 2010-07-28 09:58:57 -04:00
mark.c fsnotify: call iput on inodes when no longer marked 2010-07-28 09:59:02 -04:00
notification.c fsnotify: use unsigned char * for dentry->d_name.name 2010-07-28 09:59:01 -04:00
vfsmount_mark.c fanotify: clear all fanotify marks 2010-07-28 09:59:00 -04:00