diff options
author | Anton Altaparmakov <aia21@cam.ac.uk> | 2006-06-20 00:29:41 -0700 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2006-06-29 17:17:15 -0700 |
commit | 323e290abcbdf84afde0fbbd775f3ba4b784655a (patch) | |
tree | 790123b6e610a206ea5ad88d133f4ddd19ac6e7c | |
parent | 50cdbb604d8e4f38c30e387ef28433a02b91e6f1 (diff) | |
download | lwn-323e290abcbdf84afde0fbbd775f3ba4b784655a.tar.gz lwn-323e290abcbdf84afde0fbbd775f3ba4b784655a.zip |
[PATCH] NTFS: Critical bug fix (affects MIPS and possibly others)
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>
-rw-r--r-- | fs/ntfs/file.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index c63a83e8da98..36e1e136bb0c 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -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); } /** |