diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/quota_global.c | 27 | ||||
-rw-r--r-- | fs/ocfs2/quota_local.c | 4 |
2 files changed, 17 insertions, 14 deletions
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 332a281f217e..e49b4f1cb26b 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c | |||
@@ -717,6 +717,12 @@ static int ocfs2_release_dquot(struct dquot *dquot) | |||
717 | */ | 717 | */ |
718 | if (status < 0) | 718 | if (status < 0) |
719 | mlog_errno(status); | 719 | mlog_errno(status); |
720 | /* | ||
721 | * Clear dq_off so that we search for the structure in quota file next | ||
722 | * time we acquire it. The structure might be deleted and reallocated | ||
723 | * elsewhere by another node while our dquot structure is on freelist. | ||
724 | */ | ||
725 | dquot->dq_off = 0; | ||
720 | clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); | 726 | clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); |
721 | out_trans: | 727 | out_trans: |
722 | ocfs2_commit_trans(osb, handle); | 728 | ocfs2_commit_trans(osb, handle); |
@@ -756,16 +762,17 @@ static int ocfs2_acquire_dquot(struct dquot *dquot) | |||
756 | status = ocfs2_lock_global_qf(info, 1); | 762 | status = ocfs2_lock_global_qf(info, 1); |
757 | if (status < 0) | 763 | if (status < 0) |
758 | goto out; | 764 | goto out; |
759 | if (!test_bit(DQ_READ_B, &dquot->dq_flags)) { | 765 | status = ocfs2_qinfo_lock(info, 0); |
760 | status = ocfs2_qinfo_lock(info, 0); | 766 | if (status < 0) |
761 | if (status < 0) | 767 | goto out_dq; |
762 | goto out_dq; | 768 | /* |
763 | status = qtree_read_dquot(&info->dqi_gi, dquot); | 769 | * We always want to read dquot structure from disk because we don't |
764 | ocfs2_qinfo_unlock(info, 0); | 770 | * know what happened with it while it was on freelist. |
765 | if (status < 0) | 771 | */ |
766 | goto out_dq; | 772 | status = qtree_read_dquot(&info->dqi_gi, dquot); |
767 | } | 773 | ocfs2_qinfo_unlock(info, 0); |
768 | set_bit(DQ_READ_B, &dquot->dq_flags); | 774 | if (status < 0) |
775 | goto out_dq; | ||
769 | 776 | ||
770 | OCFS2_DQUOT(dquot)->dq_use_count++; | 777 | OCFS2_DQUOT(dquot)->dq_use_count++; |
771 | OCFS2_DQUOT(dquot)->dq_origspace = dquot->dq_dqb.dqb_curspace; | 778 | OCFS2_DQUOT(dquot)->dq_origspace = dquot->dq_dqb.dqb_curspace; |
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index 27fe7ee4874c..d0f323da0b5c 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -1303,10 +1303,6 @@ int ocfs2_local_release_dquot(handle_t *handle, struct dquot *dquot) | |||
1303 | ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); | 1303 | ocfs2_journal_dirty(handle, od->dq_chunk->qc_headerbh); |
1304 | 1304 | ||
1305 | out: | 1305 | out: |
1306 | /* Clear the read bit so that next time someone uses this | ||
1307 | * dquot he reads fresh info from disk and allocates local | ||
1308 | * dquot structure */ | ||
1309 | clear_bit(DQ_READ_B, &dquot->dq_flags); | ||
1310 | return status; | 1306 | return status; |
1311 | } | 1307 | } |
1312 | 1308 | ||