[Ocfs2-tools-devel] [PATCH 1/2] mkfs.ocfs2: Initialize fake superblock with poison

Sunil Mushran sunil.mushran at oracle.com
Tue May 5 18:16:29 PDT 2009


fill_fake_fs() creates a fake ocfs2_filesys* so as to allow us to call
select libocfs2 functions.

This patch initializes the fake superblock buffer with 0xC0 instead of 0x00
so that we get errors if we inadvertently call a libocfs2 function that we
were not supposed to.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 mkfs.ocfs2/mkfs.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkfs.ocfs2/mkfs.c b/mkfs.ocfs2/mkfs.c
index 6456386..d75cd57 100644
--- a/mkfs.ocfs2/mkfs.c
+++ b/mkfs.ocfs2/mkfs.c
@@ -188,8 +188,8 @@ static int hb_dev_skip(State *s, int system_inode)
 
 static void fill_fake_fs(State *s, ocfs2_filesys *fake_fs, void *buf)
 {
-	memset(buf, 0, s->blocksize);
-	memset(fake_fs, 0, sizeof(ocfs2_filesys));
+	memset(buf, 0xC0, s->blocksize);
+	memset(fake_fs, 0xC0, sizeof(ocfs2_filesys));
 
 	fake_fs->fs_super = buf;
 	fake_fs->fs_blocksize = s->blocksize;
-- 
1.5.6.3




More information about the Ocfs2-tools-devel mailing list