I just released NTFS 2.1.9 for 2.6 kernel. You can find the patch below
if you want to port it to the 2.4 kernel... (In fact it should pretty
much just apply as is to 2.4...)
Best regards,
=09Anton
--=20
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
---------- Forwarded message ----------
Date: Mon, 10 May 2004 10:15:40 +0100 (BST)
From: Anton Altaparmakov <ai...@ca...>
To: Andrew Morton <ak...@os...>, Linus Torvalds <tor...@os...>
Cc: lin...@vg..., m.g...@co...
Subject: [2.6.6-bk] NTFS 2.1.9 release - Fix two bugs in the decompression
engine.
Hi Andrew, Hi Linus, please do a
=09bk pull http://linux-ntfs.bkbits.net/ntfs-2.6
Thanks! This fixes two bugs in the NTFS decompression engine, one of which
was reported by Marcin Gibu=C5=82a a few days ago on lkml. Many thanks go =
to him
for the bug report, the help in tracking down the bug and testing the fix.
Best regards,
=09Anton
--=20
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This will update the following files:
Documentation/filesystems/ntfs.txt | 2 ++
fs/ntfs/ChangeLog | 14 +++++++++++++-
fs/ntfs/Makefile | 2 +-
fs/ntfs/compress.c | 29 ++++++++++++++++++++++-------
4 files changed, 38 insertions(+), 9 deletions(-)
through these ChangeSets:
<ai...@ca...> (04/05/10 1.1611)
NTFS: 2.1.9 release - Fix two bugs in the decompression engine
in handling of corner cases.
diff -Nru a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/=
ntfs.txt
--- a/Documentation/filesystems/ntfs.txt=09Mon May 10 10:09:16 2004
+++ b/Documentation/filesystems/ntfs.txt=09Mon May 10 10:09:16 2004
@@ -273,6 +273,8 @@
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLo=
g.
+2.1.9:
+=09- Fix two bugs in handling of corner cases in the decompression engine.
2.1.8:
=09- Read the $MFT mirror and compare it to the $MFT and if the two do not
=09 match, force a read-only mount and do not allow read-write remounts.
diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog=09Mon May 10 10:09:16 2004
+++ b/fs/ntfs/ChangeLog=09Mon May 10 10:09:16 2004
@@ -19,7 +19,19 @@
=09 sufficient for synchronisation here. We then just need to make sure
=09 ntfs_readpage/writepage/truncate interoperate properly with us.
-2.1.8 - Handle $MFT mirror and $LogFile, improve time ihandling, and clean=
ups.
+2.1.9 - Fix two bugs in decompression engine.
+
+=09- Fix a bug where we would not always detect that we have reached the
+=09 end of a compression block because we were ending at minus one byte
+=09 which is effectively the same as being at the end. The fix is to
+=09 check whether the uncompressed buffer has been fully filled and if so
+=09 we assume we have reached the end of the compression block. A big
+=09 thank you to Marcin Gibu=C5=82a for the bug report, the assistance in
+=09 tracking down the bug and testing the fix.
+=09- Fix a possible bug where when a compressed read is truncated to the
+=09 end of the file, the offset inside the last page was not truncated.
+
+2.1.8 - Handle $MFT mirror and $LogFile, improve time handling, and cleanu=
ps.
=09- Use get_bh() instead of manual atomic_inc() in fs/ntfs/compress.c.
=09- Modify fs/ntfs/time.c::ntfs2utc(), get_current_ntfs_time(), and
diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile
--- a/fs/ntfs/Makefile=09Mon May 10 10:09:16 2004
+++ b/fs/ntfs/Makefile=09Mon May 10 10:09:16 2004
@@ -5,7 +5,7 @@
ntfs-objs :=3D aops.o attrib.o compress.o debug.o dir.o file.o inode.o log=
file.o \
=09 mft.o mst.o namei.o super.o sysctl.o unistr.o upcase.o
-EXTRA_CFLAGS =3D -DNTFS_VERSION=3D\"2.1.8\"
+EXTRA_CFLAGS =3D -DNTFS_VERSION=3D\"2.1.9\"
ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS +=3D -DDEBUG
diff -Nru a/fs/ntfs/compress.c b/fs/ntfs/compress.c
--- a/fs/ntfs/compress.c=09Mon May 10 10:09:16 2004
+++ b/fs/ntfs/compress.c=09Mon May 10 10:09:16 2004
@@ -197,9 +197,15 @@
do_next_sb:
=09ntfs_debug("Beginning sub-block at offset =3D 0x%x in the cb.",
=09=09=09cb - cb_start);
-
-=09/* Have we reached the end of the compression block? */
-=09if (cb =3D=3D cb_end || !le16_to_cpup((u16*)cb)) {
+=09/*
+=09 * Have we reached the end of the compression block or the end of the
+=09 * decompressed data? The latter can happen for example if the current
+=09 * position in the compression block is one byte before its end so the
+=09 * first two checks do not detect it.
+=09 */
+=09if (cb =3D=3D cb_end || !le16_to_cpup((u16*)cb) ||
+=09=09=09(*dest_index =3D=3D dest_max_index &&
+=09=09=09*dest_ofs =3D=3D dest_max_ofs)) {
=09=09int i;
=09=09ntfs_debug("Completed. Returning success (0).");
@@ -501,7 +507,7 @@
=09 */
=09unsigned int nr_pages =3D (end_vcn - start_vcn) <<
=09=09=09vol->cluster_size_bits >> PAGE_CACHE_SHIFT;
-=09unsigned int xpage, max_page, cur_page, cur_ofs, i;
+=09unsigned int xpage, max_page, max_ofs, cur_page, cur_ofs, i;
=09unsigned int cb_clusters, cb_max_ofs;
=09int block, max_block, cb_max_page, bhs_size, nr_bhs, err =3D 0;
=09struct page **pages;
@@ -544,8 +550,11 @@
=09 */
=09max_page =3D ((VFS_I(ni)->i_size + PAGE_CACHE_SIZE - 1) >>
=09=09=09PAGE_CACHE_SHIFT) - offset;
-=09if (nr_pages < max_page)
+=09max_ofs =3D (VFS_I(ni)->i_size + PAGE_CACHE_SIZE - 1) & ~PAGE_CACHE_MAS=
K;
+=09if (nr_pages < max_page) {
=09=09max_page =3D nr_pages;
+=09=09max_ofs =3D 0;
+=09}
=09for (i =3D 0; i < max_page; i++, offset++) {
=09=09if (i !=3D xpage)
=09=09=09pages[i] =3D grab_cache_page_nowait(mapping, offset);
@@ -713,8 +722,14 @@
=09cb_max_page >>=3D PAGE_CACHE_SHIFT;
=09/* Catch end of file inside a compression block. */
-=09if (cb_max_page > max_page)
-=09=09cb_max_page =3D max_page;
+=09if (cb_max_page >=3D max_page) {
+=09=09if (cb_max_page > max_page) {
+=09=09=09cb_max_page =3D max_page;
+=09=09=09cb_max_ofs =3D max_ofs;
+=09=09} else if (cb_max_ofs > max_ofs) {
+=09=09=09cb_max_ofs =3D max_ofs;
+=09=09}
+=09}
=09if (vcn =3D=3D start_vcn - cb_clusters) {
=09=09/* Sparse cb, zero out page range overlapping the cb. */
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This BitKeeper patch contains the following changesets:
1.1611
## Wrapped with gzip_uu ##
M'XL( +Y> [U8Z6[;1A#^+3[%-"D"V[&D7=3DY4*C>.KQB)$\-V@J(P("S)
MI468(@7NRD>C]$??K>_5V:5N6:VO5!(D<G?VF_OCV"_AB^!EJ\929E+C);PO
MA&S5(I9+%C9R+G'II"APJ=3DDM>KPIRJB9RT34S89KX-XQDU$7KG@I6C7:L"8K
M\K;/6[63O8,O'[=3D/#*/=3DAITNRR_X*9?0;ANR**]8%HNW3':S(F_(DN6BQR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