-
Notifications
You must be signed in to change notification settings - Fork 93
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
Mount the external journal device and write accessible extent metadata #59
Conversation
During fill super, call simplefs_parse_options to find the external device path and set it as the journal device. Additionally, add the `make journal` parameter in the Makefile to create an external journal device.
In the current design of simplefs, we can only access the extent metadata and perform the 'journal' action on it. To write inode and other metadata, we might need to emulate `ext4_dirty_inode`. This method primarily uses the content of struct ext4_iloc to find the correct location of the inode on disk and records it in the journal. However, in our current situation, simply using `mark_inode_dirty` to handle dirty inodes does not allow us to obtain the inode's location, thus preventing us from recording it in the journal. But currently, the idea is that we might create a new buffer head, use `jbd2_journal_get_create_access` to put the dirty inode in it, and then use `jbd2_journal_dirty_metadata` to write it to the journal.
Avoid uploading screenshots that contain only text. Instead, use Markdown formatting to present command lists, source code, and any text-based content. This approach is more accessible for individuals with visual impairments. |
@@ -196,6 +201,251 @@ static int simplefs_statfs(struct dentry *dentry, struct kstatfs *stat) | |||
return 0; | |||
} | |||
|
|||
/* journal relation code */ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove one blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append the test suite to reflect journaling support.
Drop unnecessary |
Fix compatibility with Linux v6.5:
|
Based on feedback from previous pull requests, addressed the mentioned issues and ensured that the related external device journal loading function operates correctly in kernel version 6.5.
…o external-journal
The latest commit has addressed the mentioned issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use git rebase -i
to rework the commits.
@@ -332,8 +401,7 @@ static int simplefs_load_journal(struct super_block *sb, | |||
struct simplefs_sb_info *sbi = SIMPLEFS_SB(sb); | |||
dev_t journal_dev; | |||
int err = 0; | |||
pr_info("simplefs_load_journal: loading journal from device number %lu\n", | |||
journal_devnum); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this blank line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that journal device can be mounted for Linux kernels prior to v6.5. At least, tweak for version 6.1, 5.15, and 5.10.
See https://kernel.org/ for LTS.
@jserv Could you please clarify if you would like me to rebase all the commits into a single commit, or if there is a specific way you prefer me to rework them? Thank you! |
There should be only one commit rebasing the latest |
This pull request currently adds the parse_option in fill super to mount the external journal device to simplefs. It also writes the currently accessible extent metadata to the journal during write operations. The image below demonstrates that it is already possible to mount the external journal device in the v6.8 environment.