diff options
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index c60242018d9a..302f1144a708 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -56,7 +56,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb, | |||
56 | int node_num, int slot_num); | 56 | int node_num, int slot_num); |
57 | static int __ocfs2_recovery_thread(void *arg); | 57 | static int __ocfs2_recovery_thread(void *arg); |
58 | static int ocfs2_commit_cache(struct ocfs2_super *osb); | 58 | static int ocfs2_commit_cache(struct ocfs2_super *osb); |
59 | static int ocfs2_wait_on_mount(struct ocfs2_super *osb); | 59 | static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota); |
60 | static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, | 60 | static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, |
61 | int dirty, int replayed); | 61 | int dirty, int replayed); |
62 | static int ocfs2_trylock_journal(struct ocfs2_super *osb, | 62 | static int ocfs2_trylock_journal(struct ocfs2_super *osb, |
@@ -65,6 +65,17 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, | |||
65 | int slot); | 65 | int slot); |
66 | static int ocfs2_commit_thread(void *arg); | 66 | static int ocfs2_commit_thread(void *arg); |
67 | 67 | ||
68 | static inline int ocfs2_wait_on_mount(struct ocfs2_super *osb) | ||
69 | { | ||
70 | return __ocfs2_wait_on_mount(osb, 0); | ||
71 | } | ||
72 | |||
73 | static inline int ocfs2_wait_on_quotas(struct ocfs2_super *osb) | ||
74 | { | ||
75 | return __ocfs2_wait_on_mount(osb, 1); | ||
76 | } | ||
77 | |||
78 | |||
68 | 79 | ||
69 | /* | 80 | /* |
70 | * The recovery_list is a simple linked list of node numbers to recover. | 81 | * The recovery_list is a simple linked list of node numbers to recover. |
@@ -895,6 +906,8 @@ void ocfs2_complete_recovery(struct work_struct *work) | |||
895 | 906 | ||
896 | mlog(0, "Complete recovery for slot %d\n", item->lri_slot); | 907 | mlog(0, "Complete recovery for slot %d\n", item->lri_slot); |
897 | 908 | ||
909 | ocfs2_wait_on_quotas(osb); | ||
910 | |||
898 | la_dinode = item->lri_la_dinode; | 911 | la_dinode = item->lri_la_dinode; |
899 | if (la_dinode) { | 912 | if (la_dinode) { |
900 | mlog(0, "Clean up local alloc %llu\n", | 913 | mlog(0, "Clean up local alloc %llu\n", |
@@ -1701,13 +1714,14 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb, | |||
1701 | return ret; | 1714 | return ret; |
1702 | } | 1715 | } |
1703 | 1716 | ||
1704 | static int ocfs2_wait_on_mount(struct ocfs2_super *osb) | 1717 | static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota) |
1705 | { | 1718 | { |
1706 | /* This check is good because ocfs2 will wait on our recovery | 1719 | /* This check is good because ocfs2 will wait on our recovery |
1707 | * thread before changing it to something other than MOUNTED | 1720 | * thread before changing it to something other than MOUNTED |
1708 | * or DISABLED. */ | 1721 | * or DISABLED. */ |
1709 | wait_event(osb->osb_mount_event, | 1722 | wait_event(osb->osb_mount_event, |
1710 | atomic_read(&osb->vol_state) == VOLUME_MOUNTED || | 1723 | (!quota && atomic_read(&osb->vol_state) == VOLUME_MOUNTED) || |
1724 | atomic_read(&osb->vol_state) == VOLUME_MOUNTED_QUOTAS || | ||
1711 | atomic_read(&osb->vol_state) == VOLUME_DISABLED); | 1725 | atomic_read(&osb->vol_state) == VOLUME_DISABLED); |
1712 | 1726 | ||
1713 | /* If there's an error on mount, then we may never get to the | 1727 | /* If there's an error on mount, then we may never get to the |