Skip to content

Commit 9277f83

Browse files
biger410torvalds
authored andcommitted
ocfs2: fix value of OCFS2_INVALID_SLOT
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 skipped: static struct inode **get_local_system_inode(struct ocfs2_super *osb, int type, u32 slot) { BUG_ON(slot == OCFS2_INVALID_SLOT); ... } Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e5a15e1 commit 9277f83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ocfs2/ocfs2_fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
#define OCFS2_MAX_SLOTS 255
291291

292292
/* Slot map indicator for an empty slot */
293-
#define OCFS2_INVALID_SLOT -1
293+
#define OCFS2_INVALID_SLOT ((u16)-1)
294294

295295
#define OCFS2_VOL_UUID_LEN 16
296296
#define OCFS2_MAX_VOL_LABEL_LEN 64

0 commit comments

Comments
 (0)