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.

edge.strict_endians
cha0smaster 2005-11-16 16:27:27 +00:00
parent 418da4bd4b
commit fadcc0df7c
1 changed files with 4 additions and 2 deletions

View File

@ -772,7 +772,8 @@ s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
}
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, const s64 pos, s64 count, const void *b)
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);