diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index d46f24c68498..bc0a4707189a 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1447,28 +1447,22 @@ xfs_inactive_attrs( | |||
1447 | tp = *tpp; | 1447 | tp = *tpp; |
1448 | mp = ip->i_mount; | 1448 | mp = ip->i_mount; |
1449 | ASSERT(ip->i_d.di_forkoff != 0); | 1449 | ASSERT(ip->i_d.di_forkoff != 0); |
1450 | xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); | 1450 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); |
1451 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 1451 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
1452 | if (error) | ||
1453 | goto error_unlock; | ||
1452 | 1454 | ||
1453 | error = xfs_attr_inactive(ip); | 1455 | error = xfs_attr_inactive(ip); |
1454 | if (error) { | 1456 | if (error) |
1455 | *tpp = NULL; | 1457 | goto error_unlock; |
1456 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1457 | return error; /* goto out */ | ||
1458 | } | ||
1459 | 1458 | ||
1460 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); | 1459 | tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); |
1461 | error = xfs_trans_reserve(tp, 0, | 1460 | error = xfs_trans_reserve(tp, 0, |
1462 | XFS_IFREE_LOG_RES(mp), | 1461 | XFS_IFREE_LOG_RES(mp), |
1463 | 0, XFS_TRANS_PERM_LOG_RES, | 1462 | 0, XFS_TRANS_PERM_LOG_RES, |
1464 | XFS_INACTIVE_LOG_COUNT); | 1463 | XFS_INACTIVE_LOG_COUNT); |
1465 | if (error) { | 1464 | if (error) |
1466 | ASSERT(XFS_FORCED_SHUTDOWN(mp)); | 1465 | goto error_cancel; |
1467 | xfs_trans_cancel(tp, 0); | ||
1468 | *tpp = NULL; | ||
1469 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1470 | return error; | ||
1471 | } | ||
1472 | 1466 | ||
1473 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 1467 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
1474 | xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); | 1468 | xfs_trans_ijoin(tp, ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); |
@@ -1479,6 +1473,14 @@ xfs_inactive_attrs( | |||
1479 | 1473 | ||
1480 | *tpp = tp; | 1474 | *tpp = tp; |
1481 | return 0; | 1475 | return 0; |
1476 | |||
1477 | error_cancel: | ||
1478 | ASSERT(XFS_FORCED_SHUTDOWN(mp)); | ||
1479 | xfs_trans_cancel(tp, 0); | ||
1480 | error_unlock: | ||
1481 | *tpp = NULL; | ||
1482 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
1483 | return error; | ||
1482 | } | 1484 | } |
1483 | 1485 | ||
1484 | int | 1486 | int |