diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/quota_local.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index 71cf410e89f0..5a460fa82553 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -444,10 +444,6 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
444 | 444 | ||
445 | mlog_entry("ino=%lu type=%u", (unsigned long)lqinode->i_ino, type); | 445 | mlog_entry("ino=%lu type=%u", (unsigned long)lqinode->i_ino, type); |
446 | 446 | ||
447 | status = ocfs2_lock_global_qf(oinfo, 1); | ||
448 | if (status < 0) | ||
449 | goto out; | ||
450 | |||
451 | list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) { | 447 | list_for_each_entry_safe(rchunk, next, &(rec->r_list[type]), rc_list) { |
452 | chunk = rchunk->rc_chunk; | 448 | chunk = rchunk->rc_chunk; |
453 | hbh = NULL; | 449 | hbh = NULL; |
@@ -480,12 +476,18 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
480 | type); | 476 | type); |
481 | goto out_put_bh; | 477 | goto out_put_bh; |
482 | } | 478 | } |
479 | status = ocfs2_lock_global_qf(oinfo, 1); | ||
480 | if (status < 0) { | ||
481 | mlog_errno(status); | ||
482 | goto out_put_dquot; | ||
483 | } | ||
484 | |||
483 | handle = ocfs2_start_trans(OCFS2_SB(sb), | 485 | handle = ocfs2_start_trans(OCFS2_SB(sb), |
484 | OCFS2_QSYNC_CREDITS); | 486 | OCFS2_QSYNC_CREDITS); |
485 | if (IS_ERR(handle)) { | 487 | if (IS_ERR(handle)) { |
486 | status = PTR_ERR(handle); | 488 | status = PTR_ERR(handle); |
487 | mlog_errno(status); | 489 | mlog_errno(status); |
488 | goto out_put_dquot; | 490 | goto out_drop_lock; |
489 | } | 491 | } |
490 | mutex_lock(&sb_dqopt(sb)->dqio_mutex); | 492 | mutex_lock(&sb_dqopt(sb)->dqio_mutex); |
491 | spin_lock(&dq_data_lock); | 493 | spin_lock(&dq_data_lock); |
@@ -523,6 +525,8 @@ static int ocfs2_recover_local_quota_file(struct inode *lqinode, | |||
523 | out_commit: | 525 | out_commit: |
524 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); | 526 | mutex_unlock(&sb_dqopt(sb)->dqio_mutex); |
525 | ocfs2_commit_trans(OCFS2_SB(sb), handle); | 527 | ocfs2_commit_trans(OCFS2_SB(sb), handle); |
528 | out_drop_lock: | ||
529 | ocfs2_unlock_global_qf(oinfo, 1); | ||
526 | out_put_dquot: | 530 | out_put_dquot: |
527 | dqput(dquot); | 531 | dqput(dquot); |
528 | out_put_bh: | 532 | out_put_bh: |
@@ -537,8 +541,6 @@ out_put_bh: | |||
537 | if (status < 0) | 541 | if (status < 0) |
538 | break; | 542 | break; |
539 | } | 543 | } |
540 | ocfs2_unlock_global_qf(oinfo, 1); | ||
541 | out: | ||
542 | if (status < 0) | 544 | if (status < 0) |
543 | free_recovery_list(&(rec->r_list[type])); | 545 | free_recovery_list(&(rec->r_list[type])); |
544 | mlog_exit(status); | 546 | mlog_exit(status); |