Skip to content

Commit

Permalink
Applied fix from upstream PR ut-osa#21, with additional inode headers
Browse files Browse the repository at this point in the history
  • Loading branch information
cmolder committed Nov 20, 2021
1 parent 41e1e33 commit 44b8ba9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions kernfs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,13 @@ int digest_inode(uint8_t from_dev, uint8_t to_dev, int libfs_id,
}

inode->size = src_dinode->size;
inode->nlink = src_dinode->nlink;
inode->uid = src_dinode->uid;
inode->gid = src_dinode->gid;
inode->perms = src_dinode->perms;
inode->atime = src_dinode->atime;
inode->mtime = src_dinode->mtime;
inode->ctime = src_dinode->ctime;

mlfs_debug("[INODE] (%d->%d) inode inum %u type %d, size %lu\n",
from_dev, to_dev, inode->inum, inode->itype, inode->size);
Expand Down
7 changes: 6 additions & 1 deletion libfs/src/posix/posix_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,10 @@ int mlfs_posix_stat(const char *filename, struct stat *stat_buf)
inode = namei((char *)filename);

if (!inode) {
mlfs_posix("[POSIX] stat(%s): inode not found\n", filename);
return -ENOENT;
}
mlfs_posix("[POSIX] stat(%s): inode found\n", filename);

stati(inode, stat_buf);

Expand All @@ -475,8 +477,11 @@ int mlfs_posix_fstat(int fd, struct stat *stat_buf)

f = &g_fd_table.open_files[fd];

if (f->ref == 0)
if (f->ref == 0) {
mlfs_posix("[POSIX] fstat(%d): file not found\n", fd);
return -ENOENT;
}
mlfs_posix("[POSIX] fstat(%d): file found\n", fd);

mlfs_assert(f->ip);

Expand Down

0 comments on commit 44b8ba9

Please sign in to comment.