@@ -669,13 +669,15 @@ void ceph_fill_file_time(struct inode *inode, int issued,
669
669
CEPH_CAP_FILE_BUFFER |
670
670
CEPH_CAP_AUTH_EXCL |
671
671
CEPH_CAP_XATTR_EXCL )) {
672
- if (timespec_compare (ctime , & inode -> i_ctime ) > 0 ) {
672
+ if (ci -> i_version == 0 ||
673
+ timespec_compare (ctime , & inode -> i_ctime ) > 0 ) {
673
674
dout ("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n" ,
674
675
inode -> i_ctime .tv_sec , inode -> i_ctime .tv_nsec ,
675
676
ctime -> tv_sec , ctime -> tv_nsec );
676
677
inode -> i_ctime = * ctime ;
677
678
}
678
- if (ceph_seq_cmp (time_warp_seq , ci -> i_time_warp_seq ) > 0 ) {
679
+ if (ci -> i_version == 0 ||
680
+ ceph_seq_cmp (time_warp_seq , ci -> i_time_warp_seq ) > 0 ) {
679
681
/* the MDS did a utimes() */
680
682
dout ("mtime %ld.%09ld -> %ld.%09ld "
681
683
"tw %d -> %d\n" ,
@@ -795,7 +797,6 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
795
797
new_issued = ~issued & le32_to_cpu (info -> cap .caps );
796
798
797
799
/* update inode */
798
- ci -> i_version = le64_to_cpu (info -> version );
799
800
inode -> i_rdev = le32_to_cpu (info -> rdev );
800
801
inode -> i_blkbits = fls (le32_to_cpu (info -> layout .fl_stripe_unit )) - 1 ;
801
802
@@ -868,6 +869,9 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
868
869
xattr_blob = NULL ;
869
870
}
870
871
872
+ /* finally update i_version */
873
+ ci -> i_version = le64_to_cpu (info -> version );
874
+
871
875
inode -> i_mapping -> a_ops = & ceph_aops ;
872
876
873
877
switch (inode -> i_mode & S_IFMT ) {
0 commit comments