On Thu, Sep 13, 2018 at 11:35:10AM +0300, Nikolay Borisov wrote: > In btrfs_search_old_slot get_old_root is always used with the > assumption it cannot fail. However, this is not true in rare > circumstance it can fail and return null.
Currently this will not happen, as the code returning NULL 1383 if (!eb) 1384 return NULL; is preceed by btrfs_clone_extent_buffer or alloc_dummy_extent_buffer that will not fail due to GFP_NOFAIL in __alloc_extent_buffer. However I agree the error handling in btrfs_search_old_slot should be there as the NOFAIL semantics is hidden and may change eventually.