Commit d895a1c9 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

fs: do not drop inode_lock in dispose_list

Despite the comment above it we can not safely drop the lock here.
invalidate_list is called from many other places that just umount.
Also switch to proper list macros now that we never drop the lock.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 7ccf19a8
...@@ -482,26 +482,10 @@ static void dispose_list(struct list_head *head) ...@@ -482,26 +482,10 @@ static void dispose_list(struct list_head *head)
*/ */
static int invalidate_list(struct list_head *head, struct list_head *dispose) static int invalidate_list(struct list_head *head, struct list_head *dispose)
{ {
struct list_head *next; struct inode *inode, *next;
int busy = 0; int busy = 0;
next = head->next; list_for_each_entry_safe(inode, next, head, i_sb_list) {
for (;;) {
struct list_head *tmp = next;
struct inode *inode;
/*
* We can reschedule here without worrying about the list's
* consistency because the per-sb list of inodes must not
* change during umount anymore, and because iprune_sem keeps
* shrink_icache_memory() away.
*/
cond_resched_lock(&inode_lock);
next = next->next;
if (tmp == head)
break;
inode = list_entry(tmp, struct inode, i_sb_list);
if (inode->i_state & I_NEW) if (inode->i_state & I_NEW)
continue; continue;
if (atomic_read(&inode->i_count)) { if (atomic_read(&inode->i_count)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment