Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix symlink block allocation mismatch causing unlink bitmap errors #64

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

RoyWFHuang
Copy link
Collaborator

@RoyWFHuang RoyWFHuang commented Aug 18, 2024

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

Also fixing the warning messages.

[13519.467953] ------------[ cut here ]------------
[13519.467954] WARNING: CPU: 1 PID: 287149 at fs/inode.c:307 drop_nlink+0x2c/0x40
....
[13519.468072]  ? drop_nlink+0x2c/0x40
[13519.468074]  ? __warn+0x8c/0x100
[13519.468077]  ? drop_nlink+0x2c/0x40
[13519.468080]  ? report_bug+0xa4/0xd0
[13519.468083]  ? handle_bug+0x39/0x90
[13519.468086]  ? exc_invalid_op+0x19/0x70
[13519.468089]  ? asm_exc_invalid_op+0x1b/0x20
[13519.468094]  ? drop_nlink+0x2c/0x40
[13519.468097]  simplefs_unlink+0x2e9/0x3b0 [simplefs]

the inode_dec_link_count has included drop_nlink and mark_inode_dirty

@jserv jserv requested a review from HotMercury August 18, 2024 09:44
@HotMercury
Copy link
Collaborator

HotMercury commented Aug 19, 2024

This PR indeed fixes the symbolic link bug.
Could you please provide a test case in the test file?

@RoyWFHuang
Copy link
Collaborator Author

Updated.

@jserv jserv changed the title Fix Symbolic link remove problem Fix symlink block allocation mismatch causing unlink bitmap errors Aug 19, 2024
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consolidate the test suite to reflect the proposed changes as @HotMercury requested.

    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 functoin
we use the ei_block to clean the bitmap, this makes the unlink will clean the "0"
bit in bitmap.

Close sysprog21#58
inode_dec_link_count has included drop_nlink/ mark_inode_dirty
@RoyWFHuang RoyWFHuang requested a review from jserv August 19, 2024 14:12
@jserv jserv merged commit 31258fc into sysprog21:master Aug 20, 2024
2 checks passed
@jserv
Copy link
Collaborator

jserv commented Aug 20, 2024

Thank @RoyWFHuang for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbolic link creation fails after file deletion
3 participants