Commit e345b87
Andreas Gruenbacher
gfs2: Fix freeze consistency check in log_write_header
Functions gfs2_freeze_super() and gfs2_thaw_super() are using the
SDF_FROZEN flag to indicate when the filesystem is frozen, synchronized
by sd_freeze_mutex. However, this doesn't prevent writes from happening
between the point of calling thaw_super() and the point where the
SDF_FROZEN flag is cleared, so the following assert can trigger in
log_write_header():
gfs2_assert_withdraw(sdp, !test_bit(SDF_FROZEN, &sdp->sd_flags));
Fix that by checking for sb->s_writers.frozen != SB_FREEZE_COMPLETE in
log_write_header() instead. To make sure that the filesystem-specific
part of freezing happens before sb->s_writers.frozen is set to
SB_FREEZE_COMPLETE, move that code from gfs2_freeze_locally() into
gfs2_freeze_fs() and hook that up to the .freeze_fs operation.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>1 parent 4e58543 commit e345b87
2 files changed
Lines changed: 18 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| 916 | + | |
916 | 917 | | |
917 | | - | |
| 918 | + | |
918 | 919 | | |
919 | 920 | | |
920 | 921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | 676 | | |
699 | 677 | | |
700 | 678 | | |
| |||
724 | 702 | | |
725 | 703 | | |
726 | 704 | | |
727 | | - | |
| 705 | + | |
728 | 706 | | |
729 | 707 | | |
730 | 708 | | |
| |||
765 | 743 | | |
766 | 744 | | |
767 | 745 | | |
768 | | - | |
| 746 | + | |
769 | 747 | | |
770 | 748 | | |
771 | 749 | | |
| |||
801 | 779 | | |
802 | 780 | | |
803 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
804 | 795 | | |
805 | 796 | | |
806 | 797 | | |
| |||
1599 | 1590 | | |
1600 | 1591 | | |
1601 | 1592 | | |
| 1593 | + | |
1602 | 1594 | | |
1603 | 1595 | | |
1604 | 1596 | | |
| |||
0 commit comments