diff options
| -rw-r--r-- | fs/ceph/inode.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8bf60250309e..ae056927080d 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
| @@ -669,13 +669,15 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
| 669 | CEPH_CAP_FILE_BUFFER| | 669 | CEPH_CAP_FILE_BUFFER| |
| 670 | CEPH_CAP_AUTH_EXCL| | 670 | CEPH_CAP_AUTH_EXCL| |
| 671 | CEPH_CAP_XATTR_EXCL)) { | 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 | dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n", | 674 | dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n", |
| 674 | inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, | 675 | inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, |
| 675 | ctime->tv_sec, ctime->tv_nsec); | 676 | ctime->tv_sec, ctime->tv_nsec); |
| 676 | inode->i_ctime = *ctime; | 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 | /* the MDS did a utimes() */ | 681 | /* the MDS did a utimes() */ |
| 680 | dout("mtime %ld.%09ld -> %ld.%09ld " | 682 | dout("mtime %ld.%09ld -> %ld.%09ld " |
| 681 | "tw %d -> %d\n", | 683 | "tw %d -> %d\n", |
| @@ -795,7 +797,6 @@ static int fill_inode(struct inode *inode, struct page *locked_page, | |||
| 795 | new_issued = ~issued & le32_to_cpu(info->cap.caps); | 797 | new_issued = ~issued & le32_to_cpu(info->cap.caps); |
| 796 | 798 | ||
| 797 | /* update inode */ | 799 | /* update inode */ |
| 798 | ci->i_version = le64_to_cpu(info->version); | ||
| 799 | inode->i_rdev = le32_to_cpu(info->rdev); | 800 | inode->i_rdev = le32_to_cpu(info->rdev); |
| 800 | inode->i_blkbits = fls(le32_to_cpu(info->layout.fl_stripe_unit)) - 1; | 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 | xattr_blob = NULL; | 869 | xattr_blob = NULL; |
| 869 | } | 870 | } |
| 870 | 871 | ||
| 872 | /* finally update i_version */ | ||
| 873 | ci->i_version = le64_to_cpu(info->version); | ||
| 874 | |||
| 871 | inode->i_mapping->a_ops = &ceph_aops; | 875 | inode->i_mapping->a_ops = &ceph_aops; |
| 872 | 876 | ||
| 873 | switch (inode->i_mode & S_IFMT) { | 877 | switch (inode->i_mode & S_IFMT) { |
