gfs2-utils: RHEL7 - libgfs2: Zero de_inum.no_addr when deleting dirents

Andrew Price andyp at fedoraproject.org
Mon Sep 8 17:34:03 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=1ba7c543792e524e1a84a8cd6aa365919ee33427
Commit:        1ba7c543792e524e1a84a8cd6aa365919ee33427
Parent:        d3b234ae80910f40a3450c6a9ac852f6d8e2b453
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Thu Jun 5 10:53:07 2014 +0100
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Thu Jul 24 17:16:23 2014 +0100

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.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/libgfs2/fs_ops.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index fdd4438..015b974 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -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;
 	}


More information about the cluster-commits mailing list