Commit d0ab8368 authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

Revert "ext4: Fix warnings when freezing filesystem with journaled data"

After making ext4_writepages() properly clean all pages there is no need
for special treatment of filesystem freezing. Revert commit
e6c28a26.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230329154950.19720-13-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent ab382539
...@@ -2385,7 +2385,6 @@ static int mpage_journal_page_buffers(handle_t *handle, ...@@ -2385,7 +2385,6 @@ static int mpage_journal_page_buffers(handle_t *handle,
static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
{ {
struct address_space *mapping = mpd->inode->i_mapping; struct address_space *mapping = mpd->inode->i_mapping;
struct super_block *sb = mpd->inode->i_sb;
struct folio_batch fbatch; struct folio_batch fbatch;
unsigned int nr_folios; unsigned int nr_folios;
pgoff_t index = mpd->first_page; pgoff_t index = mpd->first_page;
...@@ -2405,15 +2404,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) ...@@ -2405,15 +2404,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
mpd->map.m_len = 0; mpd->map.m_len = 0;
mpd->next_page = index; mpd->next_page = index;
/* if (ext4_should_journal_data(mpd->inode)) {
* Start a transaction for writeback of journalled data. We don't start
* the transaction if the filesystem is frozen. In that case we
* should not have any dirty data to write anymore but possibly there
* are stray page dirty bits left by the checkpointing code so this
* loop clears them.
*/
if (ext4_should_journal_data(mpd->inode) &&
sb->s_writers.frozen < SB_FREEZE_FS) {
handle = ext4_journal_start(mpd->inode, EXT4_HT_WRITE_PAGE, handle = ext4_journal_start(mpd->inode, EXT4_HT_WRITE_PAGE,
bpp); bpp);
if (IS_ERR(handle)) if (IS_ERR(handle))
...@@ -2502,15 +2493,11 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) ...@@ -2502,15 +2493,11 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
* through a pin. * through a pin.
*/ */
if (!mpd->can_map) { if (!mpd->can_map) {
WARN_ON_ONCE(sb->s_writers.frozen ==
SB_FREEZE_COMPLETE);
err = mpage_submit_folio(mpd, folio); err = mpage_submit_folio(mpd, folio);
if (err < 0) if (err < 0)
goto out; goto out;
/* Pending dirtying of journalled data? */ /* Pending dirtying of journalled data? */
if (folio_test_checked(folio)) { if (folio_test_checked(folio)) {
WARN_ON_ONCE(sb->s_writers.frozen >=
SB_FREEZE_FS);
err = mpage_journal_page_buffers(handle, err = mpage_journal_page_buffers(handle,
mpd, &folio->page); mpd, &folio->page);
if (err < 0) if (err < 0)
......
...@@ -6293,17 +6293,6 @@ static int ext4_freeze(struct super_block *sb) ...@@ -6293,17 +6293,6 @@ static int ext4_freeze(struct super_block *sb)
if (error < 0) if (error < 0)
goto out; goto out;
/*
* Do another sync. We really should not have any dirty data
* anymore but our checkpointing code does not clear page dirty
* bits due to locking constraints so writeback still can get
* started for inodes with journalled data which triggers
* annoying warnings.
*/
error = sync_filesystem(sb);
if (error < 0)
goto out;
/* Journal blocked and flushed, clear needs_recovery flag. */ /* Journal blocked and flushed, clear needs_recovery flag. */
ext4_clear_feature_journal_needs_recovery(sb); ext4_clear_feature_journal_needs_recovery(sb);
if (ext4_orphan_file_empty(sb)) if (ext4_orphan_file_empty(sb))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment