On Fri, Sep 07, 2018 at 12:01:21PM +0900, Misono Tomohiro wrote: > On 2018/09/07 0:57, David Sterba wrote: > > On Thu, Aug 30, 2018 at 10:59:16AM +0900, Misono Tomohiro wrote: > >> Since commit d7df2c796d7e ("Btrfs attach delayed ref updates to > >> delayed ref heads"), check_delaed_ref() won't return -ENOENT. > >> > >> In btrfs_cross_ref_exist(), two variable 'ret' and 'ret2' is > >> originally used to handle -ENOENT error case. > >> > >> Since the code is not needed anymore, let's just remove 'ret2'. > > > > Good cleanup and the patch would be ok as-is. I've noticed that > > check_delayed_ref now returns only two values so it might make sense to > > turn it to bool and update the name of check_delayed_ref to make it > > clear what the return value means in the loop. > > check_delaed_ref()'s return value is: > 0 ... no cross ref found in delayed ref > 1 ... cross ref found in delayed ref > -EAGAIN ... cannot acquire lock and try again later > > so I don't think we can convert it to bool directly or > do you mean we should handle -EAGAIN in check_delayed_ref()?
Oh right, I missed there's ret = 1 in one of the branches, that makes my point moot.