diff options
Diffstat (limited to 'fs/xfs/quota/xfs_qm.c')
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 44 |
1 files changed, 8 insertions, 36 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 5b198d15e76b..6b13960cf318 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -395,13 +395,10 @@ xfs_qm_mount_quotas( | |||
395 | /* | 395 | /* |
396 | * Called from the vfsops layer. | 396 | * Called from the vfsops layer. |
397 | */ | 397 | */ |
398 | int | 398 | void |
399 | xfs_qm_unmount_quotas( | 399 | xfs_qm_unmount_quotas( |
400 | xfs_mount_t *mp) | 400 | xfs_mount_t *mp) |
401 | { | 401 | { |
402 | xfs_inode_t *uqp, *gqp; | ||
403 | int error = 0; | ||
404 | |||
405 | /* | 402 | /* |
406 | * Release the dquots that root inode, et al might be holding, | 403 | * Release the dquots that root inode, et al might be holding, |
407 | * before we flush quotas and blow away the quotainfo structure. | 404 | * before we flush quotas and blow away the quotainfo structure. |
@@ -414,43 +411,18 @@ xfs_qm_unmount_quotas( | |||
414 | xfs_qm_dqdetach(mp->m_rsumip); | 411 | xfs_qm_dqdetach(mp->m_rsumip); |
415 | 412 | ||
416 | /* | 413 | /* |
417 | * Flush out the quota inodes. | 414 | * Release the quota inodes. |
418 | */ | 415 | */ |
419 | uqp = gqp = NULL; | ||
420 | if (mp->m_quotainfo) { | 416 | if (mp->m_quotainfo) { |
421 | if ((uqp = mp->m_quotainfo->qi_uquotaip) != NULL) { | 417 | if (mp->m_quotainfo->qi_uquotaip) { |
422 | xfs_ilock(uqp, XFS_ILOCK_EXCL); | 418 | IRELE(mp->m_quotainfo->qi_uquotaip); |
423 | xfs_iflock(uqp); | 419 | mp->m_quotainfo->qi_uquotaip = NULL; |
424 | error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); | ||
425 | xfs_iunlock(uqp, XFS_ILOCK_EXCL); | ||
426 | if (unlikely(error == EFSCORRUPTED)) { | ||
427 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(1)", | ||
428 | XFS_ERRLEVEL_LOW, mp); | ||
429 | goto out; | ||
430 | } | ||
431 | } | 420 | } |
432 | if ((gqp = mp->m_quotainfo->qi_gquotaip) != NULL) { | 421 | if (mp->m_quotainfo->qi_gquotaip) { |
433 | xfs_ilock(gqp, XFS_ILOCK_EXCL); | 422 | IRELE(mp->m_quotainfo->qi_gquotaip); |
434 | xfs_iflock(gqp); | 423 | mp->m_quotainfo->qi_gquotaip = NULL; |
435 | error = xfs_iflush(gqp, XFS_IFLUSH_SYNC); | ||
436 | xfs_iunlock(gqp, XFS_ILOCK_EXCL); | ||
437 | if (unlikely(error == EFSCORRUPTED)) { | ||
438 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(2)", | ||
439 | XFS_ERRLEVEL_LOW, mp); | ||
440 | goto out; | ||
441 | } | ||
442 | } | 424 | } |
443 | } | 425 | } |
444 | if (uqp) { | ||
445 | IRELE(uqp); | ||
446 | mp->m_quotainfo->qi_uquotaip = NULL; | ||
447 | } | ||
448 | if (gqp) { | ||
449 | IRELE(gqp); | ||
450 | mp->m_quotainfo->qi_gquotaip = NULL; | ||
451 | } | ||
452 | out: | ||
453 | return XFS_ERROR(error); | ||
454 | } | 426 | } |
455 | 427 | ||
456 | /* | 428 | /* |