Re: [PATCH 11/14] xfs: widen ondisk timestamps to deal with y2038 problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> @@ -265,17 +278,35 @@ xfs_inode_from_disk(
>         if (to->di_version == 3) {
>                 inode_set_iversion_queried(inode,
>                                            be64_to_cpu(from->di_changecount));
> -               xfs_inode_from_disk_timestamp(&to->di_crtime, &from->di_crtime);
> +               xfs_inode_from_disk_timestamp(from, &to->di_crtime,
> +                               &from->di_crtime);
>                 to->di_flags2 = be64_to_cpu(from->di_flags2);
>                 to->di_cowextsize = be32_to_cpu(from->di_cowextsize);
> +               /*
> +                * Convert this inode's timestamps to bigtime format the next
> +                * time we write it out to disk.
> +                */
> +               if (xfs_sb_version_hasbigtime(&mp->m_sb))
> +                       to->di_flags2 |= XFS_DIFLAG2_BIGTIME;
>         }

This feels wrong.
incore inode has a union for timestamp.
This flag should indicate how the union should be interpreted
otherwise it is going to be very easy to stumble on that in future code.

So either convert incore timestamp now or check hasbigtime when
we write to disk.

Thanks,
Amir.



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux