Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ static int simplefs_remove_from_dir(struct inode *dir, struct dentry *dentry)
}
/* Remove file from parent directory */
for (fi = 0; fi < SIMPLEFS_FILES_PER_BLOCK; fi++) {
if (dblock->files[fi].inode == inode->i_ino) {
if (dblock->files[fi].inode == inode->i_ino &&
!strcmp(dblock->files[fi].filename, dentry->d_name.name) ) {
found = true;
if (fi != SIMPLEFS_FILES_PER_BLOCK - 1) {
memmove(dblock->files + fi, dblock->files + fi + 1,
Expand Down Expand Up @@ -896,6 +897,7 @@ static int simplefs_link(struct dentry *old_dentry,
brelse(bh);

inode_inc_link_count(inode);
ihold(inode);
d_instantiate(dentry, inode);
return ret;

Expand Down