Skip to contentSkip to conversation

Fix goal inum check

PATCH In review Johann Lombardi 2 participants 2 messages Jun 23, 2009 – Jul 6, 2009 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix goal inum check

The goal inode is specificed by inode number which belongs to [1; s_inodes_count].

--

fs/ext4/ialloc.c +1 -1
index 2f64573..29e6dc7 100644
@@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
 	if (!goal)
 		goal = sbi->s_inode_goal;
 
-	if (goal && goal < le32_to_cpu(sbi->s_es->s_inodes_count)) {
+	if (goal && goal <= le32_to_cpu(sbi->s_es->s_inodes_count)) {
 		group = (goal - 1) / EXT4_INODES_PER_GROUP(sb);
 		ino = (goal - 1) % EXT4_INODES_PER_GROUP(sb);
 		ret2 = 0;