osd: fix is_pool_snaps_mode() for empty pools

The data pool in particular has seq 0 and (initially) no removed snaps.  We
must not return true for that case, or else the OSD will use an empty
pool snap context and not the user/mds provided one.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-09-16 15:50:50 -07:00
parent 52f83d9e2d
commit 0023c8843b

View File

@ -693,7 +693,7 @@ struct pg_pool_t {
* we know which mode we're using based on whether removed_snaps is empty.
*/
bool is_pool_snaps_mode() const {
return removed_snaps.empty();
return removed_snaps.empty() && get_snap_seq() > 0;
}
bool is_removed_snap(snapid_t s) const {