From fadcc0df7c6b07402f7c7ad946d27d15f6ad1391 Mon Sep 17 00:00:00 2001 From: cha0smaster Date: Wed, 16 Nov 2005 16:27:27 +0000 Subject: [PATCH] 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. --- libntfs/attrib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index 4b1094e8..859cb054 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -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);