mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 06:31:58 +02:00
jbd2: don't load superblock in jbd2_journal_check_used_features()
Since load_superblock() has been moved to journal_init_common(), the in-memory superblock structure is initialized and contains valid data once the file system has a journal_t object, so it's safe to access it, let's drop the call to journal_get_superblock() from jbd2_journal_check_used_features() and also drop the setting/clearing of the veirfy bit of the superblock buffer. Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230811063610.2980059-4-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
c30713084b
commit
9600f3e5cf
|
|
@ -1361,8 +1361,6 @@ static int journal_get_superblock(journal_t *journal)
|
|||
bh = journal->j_sb_buffer;
|
||||
|
||||
J_ASSERT(bh != NULL);
|
||||
if (buffer_verified(bh))
|
||||
return 0;
|
||||
|
||||
err = bh_read(bh, 0);
|
||||
if (err < 0) {
|
||||
|
|
@ -1437,7 +1435,6 @@ static int journal_get_superblock(journal_t *journal)
|
|||
goto out;
|
||||
}
|
||||
}
|
||||
set_buffer_verified(bh);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
|
|
@ -2226,8 +2223,6 @@ int jbd2_journal_check_used_features(journal_t *journal, unsigned long compat,
|
|||
|
||||
if (!compat && !ro && !incompat)
|
||||
return 1;
|
||||
if (journal_get_superblock(journal))
|
||||
return 0;
|
||||
if (!jbd2_format_support_feature(journal))
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user