Commit dcbd44f7 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: fix transaction leak on remote attr set/remove failure

The xattr remote value set/remove handlers both clear args.trans in
the error path without having cancelled the transaction. This leaks
the transaction, causes warnings around returning to userspace with
locks held and leads to system lockups or other general problems.

The higher level xfs_attr_[set|remove]() functions already detect
and cancel args.trans when set in the error path. Drop the NULL
assignments from the rmtval handlers and allow the callers to clean
up the transaction correctly.
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBill O'Donnell <billodo@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent a61acc3c
......@@ -558,7 +558,6 @@ xfs_attr_rmtval_set(
return 0;
out_defer_cancel:
xfs_defer_cancel(args->trans->t_dfops);
args->trans = NULL;
return error;
}
......@@ -646,6 +645,5 @@ xfs_attr_rmtval_remove(
return 0;
out_defer_cancel:
xfs_defer_cancel(args->trans->t_dfops);
args->trans = NULL;
return error;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment