summaryrefslogtreecommitdiff
path: root/fs/ntfs/inode.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-09-08 21:15:09 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-09-08 21:15:09 +0100
commit1c7d469d47668f4664b892a6cd1c452a0c02d710 (patch)
treeb91793f34092eaa312d9f96bed80af8dfd19ad6f /fs/ntfs/inode.c
parentbbf1813fb8ff9d21171bf22e6d1f0e0393601e86 (diff)
NTFS: Truncate {a,c,m}time to the ntfs supported time granularity when
updating the times in the inode in ntfs_setattr(). Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/inode.c')
-rw-r--r--fs/ntfs/inode.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index 886214a77f90..89d844f69244 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -2430,16 +2430,18 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr)
* We skipped the truncate but must still update
* timestamps.
*/
- ia_valid |= ATTR_MTIME|ATTR_CTIME;
+ ia_valid |= ATTR_MTIME | ATTR_CTIME;
}
}
-
if (ia_valid & ATTR_ATIME)
- vi->i_atime = attr->ia_atime;
+ vi->i_atime = timespec_trunc(attr->ia_atime,
+ vi->i_sb->s_time_gran);
if (ia_valid & ATTR_MTIME)
- vi->i_mtime = attr->ia_mtime;
+ vi->i_mtime = timespec_trunc(attr->ia_mtime,
+ vi->i_sb->s_time_gran);
if (ia_valid & ATTR_CTIME)
- vi->i_ctime = attr->ia_ctime;
+ vi->i_ctime = timespec_trunc(attr->ia_ctime,
+ vi->i_sb->s_time_gran);
mark_inode_dirty(vi);
out:
return err;