Skip to content

Commit 4086eec

Browse files
committed
Fix Symbolic link remove problem
When we create symbolic link, in simplefs_new_inode function, the symbolic does not use ei_block to record the using block. But in simplefs_unlink function we use the ei_block to clean the bitmap, this makes the unlink will clean the "0" bit in bitmap. Close #58
1 parent 56d2ca0 commit 4086eec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

inode.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ static int simplefs_unlink(struct inode *dir, struct dentry *dentry)
658658
mark_inode_dirty(inode);
659659

660660
/* Free inode and index block from bitmap */
661-
put_blocks(sbi, bno, 1);
661+
if (S_ISLNK(inode->i_mode))
662+
put_blocks(sbi, bno, 1);
662663
put_inode(sbi, ino);
663664

664665
return ret;

0 commit comments

Comments
 (0)