|
@@ -444,10 +444,6 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
|
|
|
|
|
|
mlog_entry("ino=%lu type=%u", (unsigned long)lqinode->i_ino, type);
|
|
mlog_entry("ino=%lu type=%u", (unsigned long)lqinode->i_ino, type);
|
|
|
|
|
|
- status = ocfs2_lock_global_qf(oinfo, 1);
|
|
|
|
- if (status < 0)
|
|
|
|
- goto out;
|
|
|
|
-
|
|
|
|
list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) {
|
|
list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) {
|
|
chunk = rchunk->rc_chunk;
|
|
chunk = rchunk->rc_chunk;
|
|
hbh = NULL;
|
|
hbh = NULL;
|
|
@@ -480,12 +476,18 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
|
|
type);
|
|
type);
|
|
goto out_put_bh;
|
|
goto out_put_bh;
|
|
}
|
|
}
|
|
|
|
+ status = ocfs2_lock_global_qf(oinfo, 1);
|
|
|
|
+ if (status < 0) {
|
|
|
|
+ mlog_errno(status);
|
|
|
|
+ goto out_put_dquot;
|
|
|
|
+ }
|
|
|
|
+
|
|
handle = ocfs2_start_trans(OCFS2_SB(sb),
|
|
handle = ocfs2_start_trans(OCFS2_SB(sb),
|
|
OCFS2_QSYNC_CREDITS);
|
|
OCFS2_QSYNC_CREDITS);
|
|
if (IS_ERR(handle)) {
|
|
if (IS_ERR(handle)) {
|
|
status = PTR_ERR(handle);
|
|
status = PTR_ERR(handle);
|
|
mlog_errno(status);
|
|
mlog_errno(status);
|
|
- goto out_put_dquot;
|
|
|
|
|
|
+ goto out_drop_lock;
|
|
}
|
|
}
|
|
mutex_lock(&sb_dqopt(sb)->dqio_mutex);
|
|
mutex_lock(&sb_dqopt(sb)->dqio_mutex);
|
|
spin_lock(&dq_data_lock);
|
|
spin_lock(&dq_data_lock);
|
|
@@ -523,6 +525,8 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode,
|
|
out_commit:
|
|
out_commit:
|
|
mutex_unlock(&sb_dqopt(sb)->dqio_mutex);
|
|
mutex_unlock(&sb_dqopt(sb)->dqio_mutex);
|
|
ocfs2_commit_trans(OCFS2_SB(sb), handle);
|
|
ocfs2_commit_trans(OCFS2_SB(sb), handle);
|
|
|
|
+out_drop_lock:
|
|
|
|
+ ocfs2_unlock_global_qf(oinfo, 1);
|
|
out_put_dquot:
|
|
out_put_dquot:
|
|
dqput(dquot);
|
|
dqput(dquot);
|
|
out_put_bh:
|
|
out_put_bh:
|
|
@@ -537,8 +541,6 @@ out_put_bh:
|
|
if (status < 0)
|
|
if (status < 0)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- ocfs2_unlock_global_qf(oinfo, 1);
|
|
|
|
-out:
|
|
|
|
if (status < 0)
|
|
if (status < 0)
|
|
free_recovery_list(&(rec->r_list[type]));
|
|
free_recovery_list(&(rec->r_list[type]));
|
|
mlog_exit(status);
|
|
mlog_exit(status);
|