From: Samuel Just Date: Wed, 27 Jun 2012 22:16:42 +0000 (-0700) Subject: filestore: sync object_map object in lfn_remove when nlink > 1 X-Git-Tag: v0.48argonaut~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc1da958953710a16a1ee2980af8d92a7b0225fa;p=ceph.git filestore: sync object_map object in lfn_remove when nlink > 1 In the following sequence: 1) create (a, 1) 2) setattr (a, 1) 3) link (a, 1), (b, 1) 4) remove (a, 1) If we play 1-4 and then replay 1-4 again, we will end up removing (b, 1)'s attributes since nlink for (a, 1) the second time through is 1. We fix this by marking spos on the object_map header for (a, 1) when we remove (a, 1) but not eh attributes. Signed-off-by: Samuel Just --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 41433e768397..e664d476267e 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -389,6 +389,12 @@ int FileStore::lfn_unlink(coll_t cid, const hobject_t& o, r = object_map->clear(o, &spos); if (r < 0 && r != -ENOENT) return r; + } else { + /* Ensure that replay of this op doesn't result in the object_map + * going away. + */ + if (!btrfs_stable_commits) + object_map->sync(&o, &spos); } } return index->unlink(o);