summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-07-24 13:43:08 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-26 10:15:12 -0700
commitdcbd44f79986e55691600b969c14db004d741883 (patch)
tree32b8b60d85893bf71e87ea52bfcd10b559aa1bcb /fs/xfs
parenta61acc3c78df14bb9b7bfefb2cc771fcda15b8fe (diff)
downloadlinux-dcbd44f79986e55691600b969c14db004d741883.tar.bz2
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: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bill O'Donnell <billodo@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_attr_remote.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_remote.c b/fs/xfs/libxfs/xfs_attr_remote.c
index 7841e6255129..829ab20f0cd7 100644
--- a/fs/xfs/libxfs/xfs_attr_remote.c
+++ b/fs/xfs/libxfs/xfs_attr_remote.c
@@ -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;
}