diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-09-08 16:15:09 -0400 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-09-08 16:15:09 -0400 |
commit | 1c7d469d47668f4664b892a6cd1c452a0c02d710 (patch) | |
tree | b91793f34092eaa312d9f96bed80af8dfd19ad6f /fs/ntfs | |
parent | bbf1813fb8ff9d21171bf22e6d1f0e0393601e86 (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')
-rw-r--r-- | fs/ntfs/ChangeLog | 2 | ||||
-rw-r--r-- | fs/ntfs/inode.c | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index beed90c9f551..9c5af9c8a8af 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog | |||
@@ -73,6 +73,8 @@ ToDo/Notes: | |||
73 | - Fix cluster (de)allocators to work when the runlist is NULL and more | 73 | - Fix cluster (de)allocators to work when the runlist is NULL and more |
74 | importantly to take a locked runlist rather than them locking it | 74 | importantly to take a locked runlist rather than them locking it |
75 | which leads to lock reversal. | 75 | which leads to lock reversal. |
76 | - Truncate {a,c,m}time to the ntfs supported time granularity when | ||
77 | updating the times in the inode in ntfs_setattr(). | ||
76 | 78 | ||
77 | 2.1.23 - Implement extension of resident files and make writing safe as well as | 79 | 2.1.23 - Implement extension of resident files and make writing safe as well as |
78 | many bug fixes, cleanups, and enhancements... | 80 | many bug fixes, cleanups, and enhancements... |
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) | |||
2430 | * We skipped the truncate but must still update | 2430 | * We skipped the truncate but must still update |
2431 | * timestamps. | 2431 | * timestamps. |
2432 | */ | 2432 | */ |
2433 | ia_valid |= ATTR_MTIME|ATTR_CTIME; | 2433 | ia_valid |= ATTR_MTIME | ATTR_CTIME; |
2434 | } | 2434 | } |
2435 | } | 2435 | } |
2436 | |||
2437 | if (ia_valid & ATTR_ATIME) | 2436 | if (ia_valid & ATTR_ATIME) |
2438 | vi->i_atime = attr->ia_atime; | 2437 | vi->i_atime = timespec_trunc(attr->ia_atime, |
2438 | vi->i_sb->s_time_gran); | ||
2439 | if (ia_valid & ATTR_MTIME) | 2439 | if (ia_valid & ATTR_MTIME) |
2440 | vi->i_mtime = attr->ia_mtime; | 2440 | vi->i_mtime = timespec_trunc(attr->ia_mtime, |
2441 | vi->i_sb->s_time_gran); | ||
2441 | if (ia_valid & ATTR_CTIME) | 2442 | if (ia_valid & ATTR_CTIME) |
2442 | vi->i_ctime = attr->ia_ctime; | 2443 | vi->i_ctime = timespec_trunc(attr->ia_ctime, |
2444 | vi->i_sb->s_time_gran); | ||
2443 | mark_inode_dirty(vi); | 2445 | mark_inode_dirty(vi); |
2444 | out: | 2446 | out: |
2445 | return err; | 2447 | return err; |