[Ocfs2-tools-devel] [PATCH 17/30] dx_dirs: add check for invalid slot in ocfs2_new_dx_root()

Mark Fasheh mfasheh at suse.com
Wed Apr 28 18:26:22 PDT 2010


This can happen in the case of a system inode, such as the root or orphan
directories.

Signed-off-by: Mark Fasheh <mfasheh at suse.com>
Cc: Joel Becker <joel.becker at oracle.com>
Cc: Sunil Mushran <sunil.mushran at oracle.com>
---
 libocfs2/alloc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libocfs2/alloc.c b/libocfs2/alloc.c
index 84f3b05..7f85a34 100644
--- a/libocfs2/alloc.c
+++ b/libocfs2/alloc.c
@@ -658,6 +658,9 @@ errcode_t ocfs2_new_dx_root(ocfs2_filesys *fs,
 		goto out;
 
 	slot = di->i_suballoc_slot;
+	if (slot == (uint16_t)OCFS2_INVALID_SLOT)
+		slot = 0;
+
 	ret = ocfs2_load_allocator(fs, EXTENT_ALLOC_SYSTEM_INODE,
 				slot, &fs->fs_eb_allocs[slot]);
 	if (ret)
-- 
1.6.4.2




More information about the Ocfs2-tools-devel mailing list