From: Brian Foster Date: Fri, 5 Oct 2018 02:36:10 +0000 (-0500) Subject: xfs: fix transaction leak on remote attr set/remove failure X-Git-Tag: v4.19.0-rc0~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6e2c0c04afbb80a7218e4ae03a57e03e2bd3adb;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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; }