On Thu, Mar 19, 2020 at 10:51:15AM -0400, Josef Bacik wrote: > On 3/19/20 10:34 AM, David Sterba wrote: > > On Thu, Mar 19, 2020 at 10:11:32AM -0400, Josef Bacik wrote: > >> This is because we hold that delayed node's mutex while doing tree > >> operations. Fix this by just wrapping the searches in nofs. > > > > For the time being we have to do the explicit NOFS so in the code it's > > a bit awkward. The hint is a function that takes transaction as > > argument. > > > > I'm working on the scope NOFS (marked by the transaction start/end), it's > > intrusive, all over the code and there are some cases when I want to add > > assertions that turns out to be tricky for some functions. > > > > That could be cleaner, do you want me to drop this and just add a > > if (trans) > memalloc_nofs_save() > > memalloc_nofs_restore() > > in btrfs_search_slot? That'll catch all of these usages. I'm not married to > any particular approach. Thanks, Not all I think but I haven't looked closer. Maybe the search slot is used in majority of cases anyway. The outer scope between memalloc_nofs_save/memalloc_nofs_restored has been used so far and it's obvious where it starts and ends so even if it's not pretty let's use it for now.
