Skip to content

Commit

Permalink
Merge commit cmolder/assise@44b8ba9
Browse files Browse the repository at this point in the history
Applied fix from upstream PR #21, with additional inode headers
  • Loading branch information
cmolder authored and wreda committed Nov 30, 2021
1 parent 6afde42 commit 40ce234
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions kernfs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ 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 @@ -443,8 +443,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 @@ -459,8 +461,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 40ce234

Please sign in to comment.