Skip to contentSkip to conversation

libgfs2: Zero de_inum.no_addr when deleting dirents

PATCH New Andrew Price 1 participant 1 message Jun 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libgfs2: Zero de_inum.no_addr when deleting dirents

libgfs2 left deleted dirents in leaf blocks which have been split, which is fine, but it only zeroed the no_formal_ino field, causing gfs2_edit to display deleted dirents when printing leaf blocks. Zero the no_addr field too, as the kernel code does.

---
 gfs2/libgfs2/fs_ops.c | 1 +
 1 file changed, 1 insertion(+)
gfs2/libgfs2/fs_ops.c +1 -0
index fdd4438..015b974 100644
@@ -826,6 +826,7 @@ void dirent2_del(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
 		dip->i_di.di_entries--;
 	}
 	if (!prev) {
+		cur->de_inum.no_addr = 0;
 		cur->de_inum.no_formal_ino = 0;
 		return;
 	}
Signature · 1 line
1.9.3