Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28122/libntfs
Modified Files:
attrib.c
Log Message:
Fix bug in ntfs_attr_pwrite() when we sometimes lose current run in the runlist.
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -p -r1.212 -r1.213
--- attrib.c 4 Mar 2006 00:06:49 -0000 1.212
+++ attrib.c 4 Mar 2006 13:56:35 -0000 1.213
@@ -1025,18 +1025,6 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, cons
return count;
}
total = 0;
- /* Find the runlist element containing the vcn. */
- rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits);
- if (!rl) {
- /*
- * If the vcn is not present it is an out of bounds write.
- * However, we already extended the size of the attribute,
- * so getting this here must be an error of some kind.
- */
- if (errno == ENOENT)
- errno = EIO;
- goto err_out;
- }
/* Handle writes beyond initialized_size. */
if (pos + count > na->initialized_size) {
if (ntfs_attr_map_whole_runlist(na))
@@ -1102,6 +1090,18 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, cons
*/
need_to.undo_initialized_size = 1;
}
+ /* Find the runlist element containing the vcn. */
+ rl = ntfs_attr_find_vcn(na, pos >> vol->cluster_size_bits);
+ if (!rl) {
+ /*
+ * If the vcn is not present it is an out of bounds write.
+ * However, we already extended the size of the attribute,
+ * so getting this here must be an error of some kind.
+ */
+ if (errno == ENOENT)
+ errno = EIO;
+ goto err_out;
+ }
/*
* Scatter the data from the linear data buffer to the volume. Note, a
* partial final vcn is taken care of by the @count capping of write
|