From b6e2c0c04afbb80a7218e4ae03a57e03e2bd3adb Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Thu, 4 Oct 2018 21:36:10 -0500 Subject: [PATCH] xfs: fix transaction leak on remote attr set/remove failure Source kernel commit: dcbd44f79986e55691600b969c14db004d741883 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 Reviewed-by: Christoph Hellwig Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- libxfs/xfs_attr_remote.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 5841ac3a6..d05b86672 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -553,7 +553,6 @@ xfs_attr_rmtval_set( return 0; out_defer_cancel: xfs_defer_cancel(args->trans->t_dfops); - args->trans = NULL; return error; } @@ -641,6 +640,5 @@ xfs_attr_rmtval_remove( return 0; out_defer_cancel: xfs_defer_cancel(args->trans->t_dfops); - args->trans = NULL; return error; } -- 2.50.1