Skip to content

Commit d0ab836

Browse files
jankaratytso
authored andcommitted
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 e6c28a2. Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230329154950.19720-13-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent ab38253 commit d0ab836

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

fs/ext4/inode.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,6 @@ static int mpage_journal_page_buffers(handle_t *handle,
23852385
static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
23862386
{
23872387
struct address_space *mapping = mpd->inode->i_mapping;
2388-
struct super_block *sb = mpd->inode->i_sb;
23892388
struct folio_batch fbatch;
23902389
unsigned int nr_folios;
23912390
pgoff_t index = mpd->first_page;
@@ -2405,15 +2404,7 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
24052404

24062405
mpd->map.m_len = 0;
24072406
mpd->next_page = index;
2408-
/*
2409-
* Start a transaction for writeback of journalled data. We don't start
2410-
* the transaction if the filesystem is frozen. In that case we
2411-
* should not have any dirty data to write anymore but possibly there
2412-
* are stray page dirty bits left by the checkpointing code so this
2413-
* loop clears them.
2414-
*/
2415-
if (ext4_should_journal_data(mpd->inode) &&
2416-
sb->s_writers.frozen < SB_FREEZE_FS) {
2407+
if (ext4_should_journal_data(mpd->inode)) {
24172408
handle = ext4_journal_start(mpd->inode, EXT4_HT_WRITE_PAGE,
24182409
bpp);
24192410
if (IS_ERR(handle))
@@ -2502,15 +2493,11 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
25022493
* through a pin.
25032494
*/
25042495
if (!mpd->can_map) {
2505-
WARN_ON_ONCE(sb->s_writers.frozen ==
2506-
SB_FREEZE_COMPLETE);
25072496
err = mpage_submit_folio(mpd, folio);
25082497
if (err < 0)
25092498
goto out;
25102499
/* Pending dirtying of journalled data? */
25112500
if (folio_test_checked(folio)) {
2512-
WARN_ON_ONCE(sb->s_writers.frozen >=
2513-
SB_FREEZE_FS);
25142501
err = mpage_journal_page_buffers(handle,
25152502
mpd, &folio->page);
25162503
if (err < 0)

fs/ext4/super.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6293,17 +6293,6 @@ static int ext4_freeze(struct super_block *sb)
62936293
if (error < 0)
62946294
goto out;
62956295

6296-
/*
6297-
* Do another sync. We really should not have any dirty data
6298-
* anymore but our checkpointing code does not clear page dirty
6299-
* bits due to locking constraints so writeback still can get
6300-
* started for inodes with journalled data which triggers
6301-
* annoying warnings.
6302-
*/
6303-
error = sync_filesystem(sb);
6304-
if (error < 0)
6305-
goto out;
6306-
63076296
/* Journal blocked and flushed, clear needs_recovery flag. */
63086297
ext4_clear_feature_journal_needs_recovery(sb);
63096298
if (ext4_orphan_file_empty(sb))

0 commit comments

Comments
 (0)