diff options
author | Jan Kara <jack@suse.cz> | 2023-06-16 19:50:47 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-07-30 01:11:13 +0300 |
commit | 98175720c9ed3bac857b0364321517cc2d695a3f (patch) | |
tree | 2b92636f40e6185f38f25e5dfc2ee856f9ca7579 /fs/ext4/super.c | |
parent | 1d40165047456923fa4343d519353d9440cd68df (diff) | |
download | linux-98175720c9ed3bac857b0364321517cc2d695a3f.tar.xz |
ext4: remove pointless sb_rdonly() checks from freezing code
ext4_freeze() and ext4_unfreeze() checks for sb_rdonly(). However this
check is pointless as VFS already checks for read-only filesystem before
calling filesystem specific methods. Remove the pointless checks.
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230616165109.21695-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c94ebf704616..ffc4fb73f133 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6347,12 +6347,7 @@ static int ext4_sync_fs(struct super_block *sb, int wait) static int ext4_freeze(struct super_block *sb) { int error = 0; - journal_t *journal; - - if (sb_rdonly(sb)) - return 0; - - journal = EXT4_SB(sb)->s_journal; + journal_t *journal = EXT4_SB(sb)->s_journal; if (journal) { /* Now we set up the journal barrier. */ @@ -6386,7 +6381,7 @@ out: */ static int ext4_unfreeze(struct super_block *sb) { - if (sb_rdonly(sb) || ext4_forced_shutdown(EXT4_SB(sb))) + if (ext4_forced_shutdown(EXT4_SB(sb))) return 0; if (EXT4_SB(sb)->s_journal) { |