Changes by: cha0smaster
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15608/libntfs
Modified Files:
attrib.c
Log Message:
Do not update time for system files (inode number < FILE_first_user) in ntfs_attr_p{read,write}. Who cares about them, but this solves segfault during umount.
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -p -r1.197 -r1.198
--- attrib.c 15 Nov 2005 16:31:40 -0000 1.197
+++ attrib.c 16 Nov 2005 16:27:27 -0000 1.198
@@ -772,7 +772,8 @@ s64 ntfs_attr_pread(ntfs_attr *na, const
}
vol = na->ni->vol;
/* Update access time if accessing unnamed data attribute. */
- if (!NVolReadOnly(vol) && !NVolNoATime(vol) && na->type == AT_DATA &&
+ if (!NVolReadOnly(vol) && !NVolNoATime(vol) && na->ni->mft_no >=
+ FILE_first_user && na->type == AT_DATA &&
na->name == AT_UNNAMED) {
na->ni->last_access_time = time(NULL);
NInoFileNameSetDirty(na->ni);
@@ -960,7 +961,8 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, cons
return -1;
}
/* Update time if writing to unnamed data attribute. */
- if (na->type == AT_DATA && na->name == AT_UNNAMED) {
+ if (na->ni->mft_no >= FILE_first_user && na->type == AT_DATA &&
+ na->name == AT_UNNAMED) {
na->ni->last_data_change_time = time(NULL);
na->ni->last_mft_change_time = time(NULL);
NInoFileNameSetDirty(na->ni);
|