All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] break out of ext4_num_dirty_pages() when we hit max_pages
@ 2010-09-09 19:00 Eric Sandeen
  2010-09-13 21:24 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2010-09-09 19:00 UTC (permalink / raw)
  To: ext4 development

ext4_num_dirty_pages() will continue scanning after we accumulate
max_pages, possibly for a very long time without doing anything
useful at all.  When we hit max_pages, we should set done=1
so that the break will release the pagevec, exit the loop, and
return from the function.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4b8debe..d88ba4a 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1207,8 +1207,10 @@ static pgoff_t ext4_num_dirty_pages(struct inode *inode, pgoff_t idx,
 				break;
 			idx++;
 			num++;
-			if (num >= max_pages)
+			if (num >= max_pages) {
+				done = 1;
 				break;
+			}
 		}
 		pagevec_release(&pvec);
 	}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-13 21:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-09 19:00 [PATCH] break out of ext4_num_dirty_pages() when we hit max_pages Eric Sandeen
2010-09-13 21:24 ` Ted Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.