Skip to contentSkip to conversation

Don't bump up LLONG_MAX nr_to_write by a factor of 8

PATCH In review Eric Sandeen 2 participants 2 messages Sep 9, 2010 – Sep 13, 2010 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't bump up LLONG_MAX nr_to_write by a factor of 8

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.

---

fs/ext4/inode.c +6 -3
index d88ba4a..65c049c 100644
@@ -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)
maintainer
#1 lore raw
Quoted 5 lines · Eric Sandeen

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.

Added to the ext4 tree, thanks.

- Ted