@@ -512,6 +512,10 @@ __do_cache_op(unsigned long start, unsigned long end)
unsigned long chunk = PAGE_SIZE;
do {
+ unsigned long chunk_end = start + chunk;
+ if (chunk_end > end)
+ chunk_end = end;
+
if (signal_pending(current)) {
struct thread_info *ti = current_thread_info();
@@ -531,7 +535,7 @@ __do_cache_op(unsigned long start, unsigned long end)
return -ERESTART_RESTARTBLOCK;
}
- ret = flush_cache_user_range(start, start + chunk);
+ ret = flush_cache_user_range(start, chunk_end);
if (ret)
return ret;