Re: [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread David Sterba
On Thu, Mar 08, 2018 at 03:26:11PM +, Filipe Manana wrote: > On Thu, Mar 8, 2018 at 2:33 PM, David Sterba wrote: > > The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. > > In case it causes the function to return, the allocation would be > > redundant.

Re: [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread Filipe Manana
On Thu, Mar 8, 2018 at 2:33 PM, David Sterba wrote: > The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. > In case it causes the function to return, the allocation would be > redundant. Otherwise it could cause unnecessary failure if there's not > enough

[PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key

2018-03-08 Thread David Sterba
The allocation of tree_mod_elem can be delayed after tree_mod_dont_log. In case it causes the function to return, the allocation would be redundant. Otherwise it could cause unnecessary failure if there's not enough memory. Signed-off-by: David Sterba --- fs/btrfs/ctree.c | 8