From: David Zafman Date: Tue, 16 Apr 2013 06:40:13 +0000 (-0700) Subject: osd: Add flag to force version write in _write_info() X-Git-Tag: v0.61~135^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=460db089554e254426d45c096390dfc69e1f2bc4;p=ceph.git osd: Add flag to force version write in _write_info() Signed-off-by: David Zafman --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index cebeaa4b577e..18af764641b4 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2498,7 +2498,7 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch, map &past_intervals, interval_set &snap_collections, hobject_t &infos_oid, - __u8 info_struct_v, bool dirty_big_info) + __u8 info_struct_v, bool dirty_big_info, bool force_ver) { // pg state @@ -2506,7 +2506,7 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch, return -EINVAL; // Only need to write struct_v to attr when upgrading - if (info_struct_v < cur_struct_v) { + if (force_ver || info_struct_v < cur_struct_v) { bufferlist attrbl; info_struct_v = cur_struct_v; ::encode(info_struct_v, attrbl); diff --git a/src/osd/PG.h b/src/osd/PG.h index d4bdbc8e4cfa..813d1c5b212b 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1836,7 +1836,7 @@ public: map &past_intervals, interval_set &snap_collections, hobject_t &infos_oid, - __u8 info_struct_v, bool dirty_big_info); + __u8 info_struct_v, bool dirty_big_info, bool force_ver = false); static void _write_log(ObjectStore::Transaction& t, pg_log_t &log, const hobject_t &log_oid, map &divergent_priors); void write_if_dirty(ObjectStore::Transaction& t);