Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135957
b: refs/heads/master
c: aabb8fd
h: refs/heads/master
i:
  135955: 6aeb22c
v: v3
  • Loading branch information
Nick Piggin authored and Al Viro committed Mar 27, 2009
1 parent 30454b2 commit 853f8bc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1bd7903560f1f713e85188a5aaf4d2428b6c8b50
refs/heads/master: aabb8fdb41128705fd1627f56fdd571e45fdbcdb
10 changes: 8 additions & 2 deletions trunk/fs/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,12 +789,12 @@ static void add_dquot_ref(struct super_block *sb, int type)

spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
continue;
if (!atomic_read(&inode->i_writecount))
continue;
if (!dqinit_needed(inode, type))
continue;
if (inode->i_state & (I_FREEING|I_WILL_FREE))
continue;

__iget(inode);
spin_unlock(&inode_lock);
Expand Down Expand Up @@ -870,6 +870,12 @@ static void remove_dquot_ref(struct super_block *sb, int type,

spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
/*
* We have to scan also I_NEW inodes because they can already
* have quota pointer initialized. Luckily, we need to touch
* only quota pointers and these have separate locking
* (dqptr_sem).
*/
if (!IS_NOQUOTA(inode))
remove_inode_dquot_ref(inode, type, tofree_head);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/drop_caches.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void drop_pagecache_sb(struct super_block *sb)

spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_WILL_FREE))
if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
continue;
if (inode->i_mapping->nrpages == 0)
continue;
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose)
if (tmp == head)
break;
inode = list_entry(tmp, struct inode, i_sb_list);
if (inode->i_state & I_NEW)
continue;
invalidate_inode_buffers(inode);
if (!atomic_read(&inode->i_count)) {
list_move(&inode->i_list, dispose);
Expand Down
16 changes: 8 additions & 8 deletions trunk/fs/notify/inotify/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ void inotify_unmount_inodes(struct list_head *list)
struct inode *need_iput_tmp;
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
* doing an __iget/iput with MS_ACTIVE clear would actually
Expand All @@ -388,14 +396,6 @@ void inotify_unmount_inodes(struct list_head *list)
if (!atomic_read(&inode->i_count))
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 = NULL;
/* In case inotify_remove_watch_locked() drops a reference. */
Expand Down

0 comments on commit 853f8bc

Please sign in to comment.