]> err.no Git - linux-2.6/commitdiff
[PATCH] NTFS: Critical bug fix (affects MIPS and possibly others)
authorAnton Altaparmakov <aia21@cam.ac.uk>
Thu, 22 Jun 2006 21:47:15 +0000 (14:47 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 22 Jun 2006 22:05:55 +0000 (15:05 -0700)
Many thanks to Pauline Ng for the detailed bug report and analysis!

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ntfs/file.c

index c63a83e8da98b7d6737de1969a86f9c5ed066e35..36e1e136bb0c65bbdf21f0b8b19602c14964dfa1 100644 (file)
@@ -1484,14 +1484,15 @@ static inline void ntfs_flush_dcache_pages(struct page **pages,
                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);
 }
 
 /**