From: Anton Altaparmakov Many thanks to Pauline Ng for the detailed bug report and analysis! Signed-off-by: Anton Altaparmakov Cc: Signed-off-by: Andrew Morton --- fs/ntfs/file.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff -puN fs/ntfs/file.c~ntfs-critical-bug-fix-affects-mips-and-possibly-others fs/ntfs/file.c --- a/fs/ntfs/file.c~ntfs-critical-bug-fix-affects-mips-and-possibly-others +++ a/fs/ntfs/file.c @@ -1484,14 +1484,15 @@ static inline void ntfs_flush_dcache_pag unsigned nr_pages) { BUG_ON(!nr_pages); + /* + * Warning: Do not do the decrement at the same time as the call to + * flush_dcache_page() because it is a NULL macro on i386 and hence the + * decrement never happens so the loop never terminates. + */ do { - /* - * Warning: Do not do the decrement at the same time as the - * call because flush_dcache_page() is a NULL macro on i386 - * and hence the decrement never happens. - */ + --nr_pages; flush_dcache_page(pages[nr_pages]); - } while (--nr_pages > 0); + } while (nr_pages > 0); } /** _