]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix fscrypt name leak after failure to join log transaction
authorFilipe Manana <fdmanana@suse.com>
Tue, 20 Dec 2022 11:13:33 +0000 (11:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Oct 2023 20:00:46 +0000 (22:00 +0200)
commit6cd57f5c779578c2c41f6ab3dedd71aaddca4d9f
treef1eafca9737f3175eebb237d326cb4a8eb464921
parent6d05a1a7a484f1ff1459c4f5b853d94f839b26b0
btrfs: fix fscrypt name leak after failure to join log transaction

commit fee4c19937439693f2420a916169d08e88576e8e upstream.

When logging a new name, we don't expect to fail joining a log transaction
since we know at least one of the inodes was logged before in the current
transaction. However if we fail for some unexpected reason, we end up not
freeing the fscrypt name we previously allocated. So fix that by freeing
the name in case we failed to join a log transaction.

Fixes: ab3c5c18e8fa ("btrfs: setup qstr from dentrys using fscrypt helper")
Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/tree-log.c