xfs: remove the flags argument to xfs_trans_cancel
xfs_trans_cancel takes two flags arguments: XFS_TRANS_RELEASE_LOG_RES and XFS_TRANS_ABORT. Both of them are a direct product of the transaction state, and can be deducted: - any dirty transaction needs XFS_TRANS_ABORT to be properly canceled, and XFS_TRANS_ABORT is a noop for a transaction that is not dirty. - any transaction with a permanent log reservation needs XFS_TRANS_RELEASE_LOG_RES to be properly canceled, and passing XFS_TRANS_RELEASE_LOG_RES for a transaction without a permanent log reservation is invalid. So just remove the flags argument and do the right thing. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Dave Chinner

vecāks
eacb24e734
revīzija
4906e21545
@@ -568,8 +568,6 @@ xfs_qm_dqread(
|
||||
struct xfs_buf *bp;
|
||||
struct xfs_trans *tp = NULL;
|
||||
int error;
|
||||
int cancelflags = 0;
|
||||
|
||||
|
||||
dqp = kmem_zone_zalloc(xfs_qm_dqzone, KM_SLEEP);
|
||||
|
||||
@@ -617,7 +615,6 @@ xfs_qm_dqread(
|
||||
XFS_QM_DQALLOC_SPACE_RES(mp), 0);
|
||||
if (error)
|
||||
goto error1;
|
||||
cancelflags = XFS_TRANS_RELEASE_LOG_RES;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -632,7 +629,6 @@ xfs_qm_dqread(
|
||||
* allocate (ENOENT).
|
||||
*/
|
||||
trace_xfs_dqread_fail(dqp);
|
||||
cancelflags |= XFS_TRANS_ABORT;
|
||||
goto error1;
|
||||
}
|
||||
|
||||
@@ -680,7 +676,7 @@ xfs_qm_dqread(
|
||||
|
||||
error1:
|
||||
if (tp)
|
||||
xfs_trans_cancel(tp, cancelflags);
|
||||
xfs_trans_cancel(tp);
|
||||
error0:
|
||||
xfs_qm_dqdestroy(dqp);
|
||||
*O_dqpp = NULL;
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user