diff options
author | Anton Kling <anton@kling.gg> | 2024-06-26 18:33:06 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-26 18:36:23 +0200 |
commit | b857f43b58b4e1e14e069afe1da6f6a05f3e6d9c (patch) | |
tree | f59214cb99a088b3e817f49884f54cfe3b5a7718 /kernel | |
parent | a9584c6b392c508e71f6452d7be1200a5914419d (diff) |
Ext2: Bug fix
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fs/ext2.c | 4 | ||||
-rw-r--r-- | kernel/fs/vfs.c | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/kernel/fs/ext2.c b/kernel/fs/ext2.c index 4a0dbd0..5416cab 100644 --- a/kernel/fs/ext2.c +++ b/kernel/fs/ext2.c @@ -308,7 +308,7 @@ u32 ext2_find_inode(const char *file) { // The expected returned entry is a directory if (TYPE_INDICATOR_DIRECTORY != a.type_indicator) { kfree(orig_str); - kprintf("FAILED\n"); + klog(LOG_WARN, "ext2: Expected diretory but got: %d", a.type_indicator); return 0; } } @@ -431,7 +431,7 @@ int write_inode(int inode_num, u8 *data, u64 size, u64 offset, u64 *file_size, int num_blocks_required = BLOCKS_REQUIRED(fsize, block_byte_size); for (int i = num_blocks_used; i < num_blocks_required; i++) { - if (i > 12) { + if (i >= 12) { assert(0); } int b = get_free_block(1 /*true*/); diff --git a/kernel/fs/vfs.c b/kernel/fs/vfs.c index ffecc5d..4afadea 100644 --- a/kernel/fs/vfs.c +++ b/kernel/fs/vfs.c @@ -333,7 +333,6 @@ int vfs_pmread(int fd, void *buf, u64 count, int blocking, u64 offset) { return -EBADF; } if (fd < 0) { - dump_backtrace(12); kprintf("EBADF : %x\n", fd); return -EBADF; } |