mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
ext4: make s_mount_flags modifications atomic
Fast commit file system states are recorded in sbi->s_mount_flags. Fast commit expects these bit manipulations to be atomic. This patch adds helpers to make those modifications atomic. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Link: https://lore.kernel.org/r/20201106035911.1942128-21-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
da0c5d2695
commit
9b5f6c9b83
7 changed files with 52 additions and 34 deletions
|
@ -2442,7 +2442,7 @@ static int mpage_map_and_submit_extent(handle_t *handle,
|
|||
struct super_block *sb = inode->i_sb;
|
||||
|
||||
if (ext4_forced_shutdown(EXT4_SB(sb)) ||
|
||||
EXT4_SB(sb)->s_mount_flags & EXT4_MF_FS_ABORTED)
|
||||
ext4_test_mount_flag(sb, EXT4_MF_FS_ABORTED))
|
||||
goto invalidate_dirty_pages;
|
||||
/*
|
||||
* Let the uper layers retry transient errors.
|
||||
|
@ -2676,7 +2676,7 @@ static int ext4_writepages(struct address_space *mapping,
|
|||
* the stack trace.
|
||||
*/
|
||||
if (unlikely(ext4_forced_shutdown(EXT4_SB(mapping->host->i_sb)) ||
|
||||
sbi->s_mount_flags & EXT4_MF_FS_ABORTED)) {
|
||||
ext4_test_mount_flag(inode->i_sb, EXT4_MF_FS_ABORTED))) {
|
||||
ret = -EROFS;
|
||||
goto out_writepages;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue