]> git.itanic.dy.fi Git - linux-stable/commitdiff
ext4: remove pointless sb_rdonly() checks from freezing code
authorJan Kara <jack@suse.cz>
Fri, 16 Jun 2023 16:50:47 +0000 (18:50 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 29 Jul 2023 22:11:13 +0000 (18:11 -0400)
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>
fs/ext4/super.c

index c94ebf704616e5289b5a10eacddecf8f6c9862a7..ffc4fb73f133c7e76aadc00c0e4499dbe8ec7efa 100644 (file)
@@ -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 @@ static int ext4_freeze(struct super_block *sb)
  */
 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) {