Skip to contentSkip to conversation

mkfs.gfs2: Zero blocks in alignment gaps

PATCH New Andrew Price 2 participants 2 messages Apr 16, 2018 – Apr 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.gfs2: Zero blocks in alignment gaps

Stripe and bitmap alignment can leave small gaps between resource group spans, and between the superblock and the first resource group. Zero out those blocks so that we don't leave stale data in unused space.

---
 gfs2/libgfs2/libgfs2.h |  1 +
 gfs2/libgfs2/rgrp.c    |  5 +++++
 gfs2/mkfs/main_mkfs.c  | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 1 deletion(-)
gfs2/libgfs2/libgfs2.h +1 -0
index 3a54195c..05e45121 100644
@@ -211,6 +211,7 @@ extern const struct gfs2_rgrp *lgfs2_rgrp_rgrp(lgfs2_rgrp_t rg);
 extern lgfs2_rgrp_t lgfs2_rgrp_first(lgfs2_rgrps_t rgs);
 extern lgfs2_rgrp_t lgfs2_rgrp_last(lgfs2_rgrps_t rgs);
 extern lgfs2_rgrp_t lgfs2_rgrp_next(lgfs2_rgrp_t rg);
+extern lgfs2_rgrp_t lgfs2_rgrp_prev(lgfs2_rgrp_t rg);
 // Temporary function to aid API migration
 extern struct osi_node *lgfs2_rgrps_root(lgfs2_rgrps_t rgs) __attribute__((deprecated));
 
gfs2/libgfs2/rgrp.c +5 -0
index b61c5931..190715e1 100644
@@ -719,6 +719,11 @@ lgfs2_rgrp_t lgfs2_rgrp_next(lgfs2_rgrp_t rg)
 	return (lgfs2_rgrp_t)osi_next(&rg->node);
 }
 
+lgfs2_rgrp_t lgfs2_rgrp_prev(lgfs2_rgrp_t rg)
+{
+	return (lgfs2_rgrp_t)osi_prev(&rg->node);
+}
+
 lgfs2_rgrp_t lgfs2_rgrp_last(lgfs2_rgrps_t rgs)
 {
 	return (lgfs2_rgrp_t)osi_last(&rgs->root);
gfs2/mkfs/main_mkfs.c +46 -1

61 lines not on this page · raw message

Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 mkfs.gfs2: Zero blocks in alignment gaps

----- Original Message -----

Quoted 6 lines

Stripe and bitmap alignment can leave small gaps between resource group spans, and between the superblock and the first resource group. Zero out those blocks so that we don't leave stale data in unused space.

---

Looks good to me. ACK.

Regards,

Bob Peterson