Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16762/libntfs
Modified Files:
compress.c
Log Message:
Fix ntfs_is_cb_compressed for nasty runlist merging case in which
compression block was incorrectly treated as not compressed.
Index: compress.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/compress.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -p -r1.10 -r1.11
--- compress.c 21 Jun 2005 09:55:15 -0000 1.10
+++ compress.c 3 Aug 2005 21:25:43 -0000 1.11
@@ -3,6 +3,7 @@
* project.
*
* Copyright (c) 2004-2005 Anton Altaparmakov
+ * Copyright (c) 2005 Yura Pakhuchiy
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -265,9 +266,17 @@ static __inline__ BOOL ntfs_is_cb_compre
rl++;
/* Map the next runlist fragment if it is not mapped. */
if (rl->lcn < LCN_HOLE || !rl->length) {
- rl = ntfs_attr_find_vcn(na, rl->vcn);
+ VCN tvcn;
+
+ tvcn = rl->vcn;
+ rl = ntfs_attr_find_vcn(na, tvcn);
if (!rl || rl->lcn < LCN_HOLE || !rl->length)
return TRUE;
+ if (rl->vcn < tvcn) {
+ /* Runs merged. Need special handling. */
+ cb_clusters -= rl->length - (tvcn - rl->vcn);
+ continue;
+ }
}
/* If the current run is sparse, the cb is compressed. */
if (rl->lcn == LCN_HOLE)
|