|
@@ -379,6 +379,14 @@ void inotify_unmount_inodes(struct list_head *list)
|
|
struct inode *need_iput_tmp;
|
|
struct inode *need_iput_tmp;
|
|
struct list_head *watches;
|
|
struct list_head *watches;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * We cannot __iget() an inode in state I_CLEAR, I_FREEING,
|
|
|
|
+ * I_WILL_FREE, or I_NEW which is fine because by that point
|
|
|
|
+ * the inode cannot have any associated watches.
|
|
|
|
+ */
|
|
|
|
+ if (inode->i_state & (I_CLEAR|I_FREEING|I_WILL_FREE|I_NEW))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* If i_count is zero, the inode cannot have any watches and
|
|
* If i_count is zero, the inode cannot have any watches and
|
|
* doing an __iget/iput with MS_ACTIVE clear would actually
|
|
* doing an __iget/iput with MS_ACTIVE clear would actually
|
|
@@ -388,14 +396,6 @@ void inotify_unmount_inodes(struct list_head *list)
|
|
if (!atomic_read(&inode->i_count))
|
|
if (!atomic_read(&inode->i_count))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- /*
|
|
|
|
- * We cannot __iget() an inode in state I_CLEAR, I_FREEING, or
|
|
|
|
- * I_WILL_FREE which is fine because by that point the inode
|
|
|
|
- * cannot have any associated watches.
|
|
|
|
- */
|
|
|
|
- if (inode->i_state & (I_CLEAR | I_FREEING | I_WILL_FREE))
|
|
|
|
- continue;
|
|
|
|
-
|
|
|
|
need_iput_tmp = need_iput;
|
|
need_iput_tmp = need_iput;
|
|
need_iput = NULL;
|
|
need_iput = NULL;
|
|
/* In case inotify_remove_watch_locked() drops a reference. */
|
|
/* In case inotify_remove_watch_locked() drops a reference. */
|