diff options
| author | Jan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de> | 2016-07-26 15:24:46 +0200 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-08-26 15:51:56 +0200 |
| commit | 08b83025dbff0cf59c6de550262999b3959067b2 (patch) | |
| tree | 5ac342feceeb1ca074a814f2ae6b2845faaab130 /fs/notify | |
| parent | 24ef4e981628905d69e9ebcdcd3b30f4c8b9460f (diff) | |
3.10.65 -> 3.10.66
Diffstat (limited to 'fs/notify')
| -rw-r--r-- | fs/notify/inode_mark.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 74825be65..fbb9dfb7b 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c @@ -288,20 +288,25 @@ void fsnotify_unmount_inodes(struct list_head *list) spin_unlock(&inode->i_lock); /* In case the dropping of a reference would nuke next_i. */ - if ((&next_i->i_sb_list != list) && - atomic_read(&next_i->i_count)) { + while (&next_i->i_sb_list != list) { spin_lock(&next_i->i_lock); - if (!(next_i->i_state & (I_FREEING | I_WILL_FREE))) { + if (!(next_i->i_state & (I_FREEING | I_WILL_FREE)) && + atomic_read(&next_i->i_count)) { __iget(next_i); need_iput = next_i; + spin_unlock(&next_i->i_lock); + break; } spin_unlock(&next_i->i_lock); + next_i = list_entry(next_i->i_sb_list.next, + struct inode, i_sb_list); } /* - * We can safely drop inode_sb_list_lock here because we hold - * references on both inode and next_i. Also no new inodes - * will be added since the umount has begun. + * We can safely drop inode_sb_list_lock here because either + * we actually hold references on both inode and next_i or + * end of list. Also no new inodes will be added since the + * umount has begun. */ spin_unlock(&inode_sb_list_lock); |
