Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159103817
D57371.id179011.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57371.id179011.diff
View Options
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -647,7 +647,8 @@
* If for some reason getting the time fails, we will use
* the last time that the superblock was updated.
*/
- if (clock_gettime(CLOCK_REALTIME_FAST, &time) == 0)
+ if (clock_gettime(CLOCK_REALTIME_FAST, &time) == 0 &&
+ time.tv_sec > sblock.fs_time)
now = time.tv_sec;
else
now = sblock.fs_time;
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -189,8 +189,10 @@
{
struct ufs1_dinode *dip1;
struct ufs2_dinode *dip2;
+ time_t now;
int error;
+ now = time_second > fs->fs_time ? time_second : fs->fs_time;
if (I_IS_UFS1(ip)) {
dip1 = ip->i_din1;
*dip1 =
@@ -203,7 +205,7 @@
ip->i_gen = dip1->di_gen;
ip->i_uid = dip1->di_uid;
ip->i_gid = dip1->di_gid;
- if (ffs_oldfscompat_inode_read(fs, ip->i_dp, time_second) &&
+ if (ffs_oldfscompat_inode_read(fs, ip->i_dp, now) &&
fs->fs_ronly == 0)
UFS_INODE_SET_FLAG(ip, IN_MODIFIED);
return (0);
@@ -225,8 +227,7 @@
ip->i_gen = dip2->di_gen;
ip->i_uid = dip2->di_uid;
ip->i_gid = dip2->di_gid;
- if (ffs_oldfscompat_inode_read(fs, ip->i_dp, time_second) &&
- fs->fs_ronly == 0)
+ if (ffs_oldfscompat_inode_read(fs, ip->i_dp, now) && fs->fs_ronly == 0)
UFS_INODE_SET_FLAG(ip, IN_MODIFIED);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 11, 4:15 AM (5 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33866807
Default Alt Text
D57371.id179011.diff (1 KB)
Attached To
Mode
D57371: Avoid incorrect UFS1 timestamp corrections when system clock fails at boot
Attached
Detach File
Event Timeline
Log In to Comment