• Brian Foster's avatar
    xfs: fix error handling in xfs_qm_log_quotaoff() · 5d45ee1b
    Brian Foster authored
    The error handling in xfs_qm_log_quotaoff() has a couple problems. If
    xfs_trans_commit() fails, we fall through to the error block and call
    xfs_trans_cancel(). This is incorrect on commit failure. If
    xfs_trans_reserve() fails, we jump to the error block, cancel the tp and
    restore the superblock qflags to oldsbqflag. However, oldsbqflag has
    been initialized to zero and not yet updated from the original flags so
    we set the flags to zero.
    
    Fix up the error handling in xfs_qm_log_quotaoff() to not restore flags
    if they haven't been modified and not cancel the tp on commit failure.
    Remove the flag restore code altogether because commit error is the only
    failure condition and we don't know whether the transaction made it to
    disk.
    Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    5d45ee1b
xfs_qm_syscalls.c 26.8 KB