summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f4e737)
raw | patch | inline | side by side (parent: 6f4e737)
author | Florian Forster <octo@noris.net> | |
Wed, 30 Sep 2009 16:16:15 +0000 (18:16 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Wed, 30 Sep 2009 16:16:15 +0000 (18:16 +0200) |
src/netapp.c | patch | blob | history |
diff --git a/src/netapp.c b/src/netapp.c
index 7f0fa199f3c99ef801e07b72f54c34d330420f4c..b11e9fa263281aff605b1881f7e1912f0f09e261 100644 (file)
--- a/src/netapp.c
+++ b/src/netapp.c
snap_reserve_free = 0;
snap_reserve_used = v->snap_reserved;
snap_norm_used = v->snap_used - v->snap_reserved;
- if (HAS_ALL_FLAGS (v->flags, HAVE_VOLUME_USAGE_NORM_USED)
- && (norm_used >= snap_norm_used))
- norm_used -= snap_norm_used;
+ }
+ }
+
+ /* The space used by snapshots but not reserved for them is included in
+ * both, norm_used and snap_norm_used. If possible, subtract this here. */
+ if (HAS_ALL_FLAGS (v->flags, HAVE_VOLUME_USAGE_NORM_USED | HAVE_VOLUME_USAGE_SNAP_USED))
+ {
+ if (norm_used >= snap_norm_used)
+ norm_used -= snap_norm_used;
+ else
+ {
+ ERROR ("netapp plugin: (norm_used = %"PRIu64") < (snap_norm_used = "
+ "%"PRIu64"). Invalidating both.",
+ norm_used, snap_norm_used);
+ v->flags &= ~(HAVE_VOLUME_USAGE_NORM_USED | HAVE_VOLUME_USAGE_SNAP_USED);
}
}