Re: [PATCH] btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem

2016-09-20 Thread Nikolay Borisov
[Resend due to gmail mobile interface defaulting to html layout] >> >> We know its returning -ENOENT, so it should in theory be enough to just >> goto again_search_slot, assuming that we just raced with the deletion. > > > I will apply this on the machine which are exhibitting problems and will > r

Re: [PATCH] btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem

2016-09-19 Thread David Sterba
On Mon, Sep 19, 2016 at 02:49:41PM -0400, Chris Mason wrote: > On 09/19/2016 02:13 PM, David Sterba wrote: > > On Wed, Sep 07, 2016 at 10:38:58AM +0300, Nikolay Borisov wrote: > >> btrfs_uuid_iter_rem is able to return -ENOENT, however this condition > >> is not handled in btrfs_uuid_tree_iterate w

Re: [PATCH] btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem

2016-09-19 Thread Chris Mason
On 09/19/2016 02:13 PM, David Sterba wrote: On Wed, Sep 07, 2016 at 10:38:58AM +0300, Nikolay Borisov wrote: btrfs_uuid_iter_rem is able to return -ENOENT, however this condition is not handled in btrfs_uuid_tree_iterate which can lead to calling btrfs_next_item with freed path argument, leading

Re: [PATCH] btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem

2016-09-19 Thread David Sterba
On Wed, Sep 07, 2016 at 10:38:58AM +0300, Nikolay Borisov wrote: > btrfs_uuid_iter_rem is able to return -ENOENT, however this condition > is not handled in btrfs_uuid_tree_iterate which can lead to calling > btrfs_next_item with freed path argument, leading to a null pointer > dereference. Fix it

[PATCH] btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem

2016-09-07 Thread Nikolay Borisov
btrfs_uuid_iter_rem is able to return -ENOENT, however this condition is not handled in btrfs_uuid_tree_iterate which can lead to calling btrfs_next_item with freed path argument, leading to a null pointer dereference. Fix it by redoing the search but with an incremented objectid so we don't loop o