Browse Source

ceph: prevent i_version from going back

inode info from non-auth can be stale.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Yan, Zheng 7 years ago
parent
commit
aae1a442f8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      fs/ceph/inode.c

+ 2 - 1
fs/ceph/inode.c

@@ -889,7 +889,8 @@ static int fill_inode(struct inode *inode, struct page *locked_page,
 	}
 
 	/* finally update i_version */
-	ci->i_version = le64_to_cpu(info->version);
+	if (le64_to_cpu(info->version) > ci->i_version)
+		ci->i_version = le64_to_cpu(info->version);
 
 	inode->i_mapping->a_ops = &ceph_aops;