Skip to content

Commit c0a0b97

Browse files
DamenlySherryYang1
authored andcommitted
ocfs2: mark dquot as inactive if failed to start trans while releasing dquot
[ Upstream commit 276c613 ] While running fstests generic/329, the kernel workqueue quota_release_workfn is dead looping in calling ocfs2_release_dquot(). The ocfs2 state is already readonly but ocfs2_release_dquot wants to start a transaction but fails and returns. ===================================================================== [ 2918.123602 ][ T275 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. [ 2918.124034 ][ T275 ] (kworker/u135:1,275,11):ocfs2_release_dquot:765 ERROR: status = -30 [ 2918.124452 ][ T275 ] (kworker/u135:1,275,11):ocfs2_release_dquot:795 ERROR: status = -30 [ 2918.124883 ][ T275 ] (kworker/u135:1,275,11):ocfs2_start_trans:357 ERROR: status = -30 [ 2918.125276 ][ T275 ] OCFS2: abort (device dm-0): ocfs2_start_trans: Detected aborted journal [ 2918.125710 ][ T275 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. ===================================================================== ocfs2_release_dquot() is much like dquot_release(), which is called by ext4 to handle similar situation. So here fix it by marking the dquot as inactive like what dquot_release() does. Link: https://lkml.kernel.org/r/[email protected] Fixes: 9e33d69 ("ocfs2: Implementation of local and global quota file handling") Signed-off-by: Su Yue <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit ab3e71ae07c8294a4a2fa32ee4e3ca7c3cfc34f7) Signed-off-by: Sherry Yang <[email protected]>
1 parent 2bccda7 commit c0a0b97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/ocfs2/quota_global.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,11 @@ static int ocfs2_release_dquot(struct dquot *dquot)
749749
handle = ocfs2_start_trans(osb,
750750
ocfs2_calc_qdel_credits(dquot->dq_sb, dquot->dq_id.type));
751751
if (IS_ERR(handle)) {
752+
/*
753+
* Mark dquot as inactive to avoid endless cycle in
754+
* quota_release_workfn().
755+
*/
756+
clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
752757
status = PTR_ERR(handle);
753758
mlog_errno(status);
754759
goto out_ilock;

0 commit comments

Comments
 (0)