]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - mm/page-writeback.c
lib/radix-tree.c: fix overflow in radix_tree_range_tag_if_tagged()
[net-next-2.6.git] / mm / page-writeback.c
index 7262aacea8a201c073bd7ee5522f2e4b59fec937..c09ef5219cbe36f267a37f55d6fc670815082522 100644 (file)
@@ -836,7 +836,8 @@ void tag_pages_for_writeback(struct address_space *mapping,
                spin_unlock_irq(&mapping->tree_lock);
                WARN_ON_ONCE(tagged > WRITEBACK_TAG_BATCH);
                cond_resched();
-       } while (tagged >= WRITEBACK_TAG_BATCH);
+               /* We check 'start' to handle wrapping when end == ~0UL */
+       } while (tagged >= WRITEBACK_TAG_BATCH && start);
 }
 EXPORT_SYMBOL(tag_pages_for_writeback);