Btrfs: don't BUG_ON() in btrfs_truncate_inode_items()
authorOmar Sandoval <osandov@fb.com>
Fri, 11 May 2018 20:13:31 +0000 (13:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:28 +0000 (07:50 +0200)
commit3bf165384e82f70571ba2f439391dab86eddb23d
tree1b75dee7659b3aad2bbf57ab543cb69dde4ff15f
parentef61d940cd9684ebb910b12d4d0936c2ffc1f811
Btrfs: don't BUG_ON() in btrfs_truncate_inode_items()

[ Upstream commit 0552210997badb6a60740a26ff9d976a416510f0 ]

btrfs_free_extent() can fail because of ENOMEM. There's no reason to
panic here, we can just abort the transaction.

Fixes: f4b9aa8d3b87 ("btrfs_truncate")
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c