btrfs: use on-stack variable for block reserve in btrfs_truncate()
authorDavid Sterba <dsterba@suse.com>
Wed, 4 Jun 2025 09:29:25 +0000 (11:29 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:53:31 +0000 (23:53 +0200)
commit7ce22f62b2c5b022841ef51b7f8636484dc713a6
treecad035908a1130713d7078fbb73324ae81d1e386
parentec41c345477fe81a17f0c0a95957ce5bc9bd07b8
btrfs: use on-stack variable for block reserve in btrfs_truncate()

We can avoid potential memory allocation failure in btrfs_truncate() as
the block reserve lifetime is limited to the scope of the function. This
requires +48 bytes on stack.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c