linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't bump up LLONG_MAX nr_to_write by a factor of 8
@ 2010-09-09 19:03 Eric Sandeen
  2010-09-13 21:25 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2010-09-09 19:03 UTC (permalink / raw)
  To: ext4 development

I'm uneasy with lots of stuff going on in ext4_da_writepages(),
but bumping nr_to_write from LLONG_MAX to -8 clearly isn't
making anything better, so avoid the multiplier in that case.

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

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d88ba4a..65c049c 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3004,9 +3004,12 @@ static int ext4_da_writepages(struct address_space *mapping,
 	 * sbi->max_writeback_mb_bump whichever is smaller.
 	 */
 	max_pages = sbi->s_max_writeback_mb_bump << (20 - PAGE_CACHE_SHIFT);
-	if (!range_cyclic && range_whole)
-		desired_nr_to_write = wbc->nr_to_write * 8;
-	else
+	if (!range_cyclic && range_whole) {
+		if (wbc->nr_to_write == LLONG_MAX)
+			desired_nr_to_write = wbc->nr_to_write;
+		else
+			desired_nr_to_write = wbc->nr_to_write * 8;
+	} else
 		desired_nr_to_write = ext4_num_dirty_pages(inode, index,
 							   max_pages);
 	if (desired_nr_to_write > max_pages)


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

* Re: [PATCH] Don't bump up LLONG_MAX nr_to_write by a factor of 8
  2010-09-09 19:03 [PATCH] Don't bump up LLONG_MAX nr_to_write by a factor of 8 Eric Sandeen
@ 2010-09-13 21:25 ` Ted Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Ted Ts'o @ 2010-09-13 21:25 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On Thu, Sep 09, 2010 at 02:03:37PM -0500, Eric Sandeen wrote:
> I'm uneasy with lots of stuff going on in ext4_da_writepages(),
> but bumping nr_to_write from LLONG_MAX to -8 clearly isn't
> making anything better, so avoid the multiplier in that case.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Added to the ext4 tree, thanks.

						- Ted

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

end of thread, other threads:[~2010-09-13 21:25 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:03 [PATCH] Don't bump up LLONG_MAX nr_to_write by a factor of 8 Eric Sandeen
2010-09-13 21:25 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).