File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,8 @@ static int simplefs_remove_from_dir(struct inode *dir, struct dentry *dentry)
472472 }
473473 /* Remove file from parent directory */
474474 for (fi = 0 ; fi < SIMPLEFS_FILES_PER_BLOCK ; fi ++ ) {
475- if (dblock -> files [fi ].inode == inode -> i_ino ) {
475+ if (dblock -> files [fi ].inode == inode -> i_ino &&
476+ !strcmp (dblock -> files [fi ].filename , dentry -> d_name .name ) ) {
476477 found = true;
477478 if (fi != SIMPLEFS_FILES_PER_BLOCK - 1 ) {
478479 memmove (dblock -> files + fi , dblock -> files + fi + 1 ,
@@ -896,6 +897,7 @@ static int simplefs_link(struct dentry *old_dentry,
896897 brelse (bh );
897898
898899 inode_inc_link_count (inode );
900+ ihold (inode );
899901 d_instantiate (dentry , inode );
900902 return ret ;
901903
You can’t perform that action at this time.
0 commit comments