From 3aefbc023a9d9f910e29cd0b488896e835cbe569 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 16 Jan 2009 13:28:10 -0800 Subject: [PATCH] mds: fix inode version projected on open O_CREAT, too See 461cb1a6438d5f474d2958019fa5d42628d3a490 --- src/mds/Server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 3ed8d0407c8..53bf23583c3 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5118,7 +5118,8 @@ public: dn->pop_projected_linkage(); // dirty inode, dn, dir - newi->mark_dirty(newi->inode.version + 1, mdr->ls); + newi->inode.version--; // a bit hacky, see C_MDS_mknod_finish + newi->mark_dirty(newi->inode.version+1, mdr->ls); mdr->apply(); @@ -5179,7 +5180,7 @@ void Server::handle_client_openc(MDRequest *mdr) dn->push_projected_linkage(in); in->inode.mode = req->head.args.open.mode | S_IFREG; - in->inode.version = dn->pre_dirty() - 1; + in->inode.version = dn->pre_dirty(); in->inode.max_size = (cmode & CEPH_FILE_MODE_WR) ? in->get_layout_size_increment() : 0; in->inode.rstat.rfiles = 1;