]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] NTFS: Critical bug fix (affects MIPS and possibly others)
authorAnton Altaparmakov <aia21@cam.ac.uk>
Tue, 20 Jun 2006 07:29:41 +0000 (00:29 -0700)
committerChris Wright <chrisw@sous-sol.org>
Thu, 22 Jun 2006 19:16:12 +0000 (12:16 -0700)
It fixes a crash in NTFS on architectures where flush_dcache_page()
is a real function.  I never noticed this as all my testing is done on
i386 where flush_dcache_page() is NULL.

http://bugzilla.kernel.org/show_bug.cgi?id=6700

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: Chris Wright <chrisw@sous-sol.org>
fs/ntfs/file.c

index 5027d3d1b3fe7dfe78523f667160fb97639ed4cb..89449d3967a3a42bafde7ec5083b035d153f8779 100644 (file)
@@ -1489,14 +1489,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);
 }
 
 /**