Commit f0ca5323 authored by Junxiao Bi's avatar Junxiao Bi Committed by Sasha Levin
Browse files

ocfs2: fix value of OCFS2_INVALID_SLOT

commit 9277f833 upstream.

In the ocfs2 disk layout, slot number is 16 bits, but in ocfs2
implementation, slot number is 32 bits.  Usually this will not cause any
issue, because slot number is converted from u16 to u32, but
OCFS2_INVALID_SLOT was defined as -1, when an invalid slot number from
disk was obtained, its value was (u16)-1, and it was converted to u32.
Then the following checking in get_local_system_inode will be always

 static struct inode **get_local_system_inode(struct ocfs2_super *osb,
                                               int type,
                                               u32 slot)


Signed-off-by: default avatarJunxiao Bi <>
Reviewed-by: default avatarJoseph Qi <>
Cc: Mark Fasheh <>
Cc: Joel Becker <>
Cc: Changwei Ge <>
Cc: Gang He <>
Cc: Jun Piao <>
Cc: <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 4fad888a
......@@ -290,7 +290,7 @@
#define OCFS2_MAX_SLOTS 255
/* Slot map indicator for an empty slot */
#define OCFS2_INVALID_SLOT ((u16)-1)
#define OCFS2_VOL_UUID_LEN 16
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment