[Ocfs2-tools-commits] taoma commits r1356 - trunk/libocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu May 31 19:56:04 PDT 2007


Author: taoma
Date: 2007-05-31 19:56:01 -0700 (Thu, 31 May 2007)
New Revision: 1356

Modified:
   trunk/libocfs2/alloc.c
Log:
Fix ocfs2_delete_inode to be fit for deleting system inodes.

ocfs2_delete_inode uses wrong inode allocator to free the system inode,
so fix it.

Signed-off-by:jlbec

Modified: trunk/libocfs2/alloc.c
===================================================================
--- trunk/libocfs2/alloc.c	2007-05-28 01:26:35 UTC (rev 1355)
+++ trunk/libocfs2/alloc.c	2007-06-01 02:56:01 UTC (rev 1356)
@@ -279,7 +279,7 @@
 	errcode_t ret;
 	char *buf;
 	struct ocfs2_dinode *di;
-	int slot;
+	int16_t slot;
 	ocfs2_cached_inode **inode_alloc;
 
 	ret = ocfs2_malloc_block(fs->fs_io, &buf);
@@ -292,13 +292,17 @@
 	di = (struct ocfs2_dinode *)buf;
 	slot = di->i_suballoc_slot;
 
-	if (slot == OCFS2_INVALID_SLOT)
+	if (slot == OCFS2_INVALID_SLOT) {
 		inode_alloc = &fs->fs_system_inode_alloc;
-	else
+		ret = ocfs2_load_allocator(fs, GLOBAL_INODE_ALLOC_SYSTEM_INODE,
+					   0, inode_alloc);
+	}
+	else {
 		inode_alloc = &fs->fs_inode_allocs[slot];
+		ret = ocfs2_load_allocator(fs, INODE_ALLOC_SYSTEM_INODE, slot,
+					   inode_alloc);
+	}
 
-	ret = ocfs2_load_allocator(fs, INODE_ALLOC_SYSTEM_INODE, slot,
-				   inode_alloc);
 	if (ret)
 		goto out;
 




More information about the Ocfs2-tools-commits mailing list