Skip to content

Commit 437f88c

Browse files
sandeentytso
authored andcommitted
ext4: fix freeze deadlock under IO
Commit 6b0310f caused a regression resulting in deadlocks when freezing a filesystem which had active IO; the vfs_check_frozen level (SB_FREEZE_WRITE) did not let the freeze-related IO syncing through. Duh. Changing the test to FREEZE_TRANS should let the normal freeze syncing get through the fs, but still block any transactions from starting once the fs is completely frozen. I tested this by running fsstress in the background while periodically snapshotting the fs and running fsck on the result. I ran into occasional deadlocks, but different ones. I think this is a fine fix for the problem at hand, and the other deadlocky things will need more investigation. Reported-by: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 4538821 commit 437f88c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎fs/ext4/super.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
241241
if (sb->s_flags & MS_RDONLY)
242242
return ERR_PTR(-EROFS);
243243

244-
vfs_check_frozen(sb, SB_FREEZE_WRITE);
244+
vfs_check_frozen(sb, SB_FREEZE_TRANS);
245245
/* Special case here: if the journal has aborted behind our
246246
* backs (eg. EIO in the commit thread), then we still need to
247247
* take the FS itself readonly cleanly. */
@@ -3608,7 +3608,7 @@ int ext4_force_commit(struct super_block *sb)
36083608

36093609
journal = EXT4_SB(sb)->s_journal;
36103610
if (journal) {
3611-
vfs_check_frozen(sb, SB_FREEZE_WRITE);
3611+
vfs_check_frozen(sb, SB_FREEZE_TRANS);
36123612
ret = ext4_journal_force_commit(journal);
36133613
}
36143614

0 commit comments

Comments
 (0)