diff options
| -rw-r--r-- | fs/xfs/xfs_qm_syscalls.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 80f2d77d929a..d1e0ab7a5d12 100644 --- a/fs/xfs/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c | |||
| @@ -784,19 +784,21 @@ xfs_qm_log_quotaoff( | |||
| 784 | { | 784 | { |
| 785 | xfs_trans_t *tp; | 785 | xfs_trans_t *tp; |
| 786 | int error; | 786 | int error; |
| 787 | xfs_qoff_logitem_t *qoffi=NULL; | 787 | xfs_qoff_logitem_t *qoffi; |
| 788 | uint oldsbqflag=0; | 788 | |
| 789 | *qoffstartp = NULL; | ||
| 789 | 790 | ||
| 790 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); | 791 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); |
| 791 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_quotaoff, 0, 0); | 792 | error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_quotaoff, 0, 0); |
| 792 | if (error) | 793 | if (error) { |
| 793 | goto error0; | 794 | xfs_trans_cancel(tp, 0); |
| 795 | goto out; | ||
| 796 | } | ||
| 794 | 797 | ||
| 795 | qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); | 798 | qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); |
| 796 | xfs_trans_log_quotaoff_item(tp, qoffi); | 799 | xfs_trans_log_quotaoff_item(tp, qoffi); |
| 797 | 800 | ||
| 798 | spin_lock(&mp->m_sb_lock); | 801 | spin_lock(&mp->m_sb_lock); |
| 799 | oldsbqflag = mp->m_sb.sb_qflags; | ||
| 800 | mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; | 802 | mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; |
| 801 | spin_unlock(&mp->m_sb_lock); | 803 | spin_unlock(&mp->m_sb_lock); |
| 802 | 804 | ||
| @@ -809,19 +811,11 @@ xfs_qm_log_quotaoff( | |||
| 809 | */ | 811 | */ |
| 810 | xfs_trans_set_sync(tp); | 812 | xfs_trans_set_sync(tp); |
| 811 | error = xfs_trans_commit(tp, 0); | 813 | error = xfs_trans_commit(tp, 0); |
| 814 | if (error) | ||
| 815 | goto out; | ||
| 812 | 816 | ||
| 813 | error0: | ||
| 814 | if (error) { | ||
| 815 | xfs_trans_cancel(tp, 0); | ||
| 816 | /* | ||
| 817 | * No one else is modifying sb_qflags, so this is OK. | ||
| 818 | * We still hold the quotaofflock. | ||
| 819 | */ | ||
| 820 | spin_lock(&mp->m_sb_lock); | ||
| 821 | mp->m_sb.sb_qflags = oldsbqflag; | ||
| 822 | spin_unlock(&mp->m_sb_lock); | ||
| 823 | } | ||
| 824 | *qoffstartp = qoffi; | 817 | *qoffstartp = qoffi; |
| 818 | out: | ||
| 825 | return error; | 819 | return error; |
| 826 | } | 820 | } |
| 827 | 821 | ||
