diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index c4e81dfb74ba4f9a3604655d52a96f5832f75e6d..78502c166814f596c2fc5be589749d915c4e5076 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -573,8 +573,11 @@ struct inode *ext2_new_inode(struct inode *dir, int mode, inode->i_generation = sbi->s_next_generation++; spin_unlock(&sbi->s_next_gen_lock); if (insert_inode_locked(inode) < 0) { - err = -EINVAL; - goto fail_drop; + ext2_error(sb, "ext2_new_inode", + "inode number already in use - inode=%lu", + (unsigned long) ino); + err = -EIO; + goto fail; } dquot_initialize(inode);