Re: [syzbot] [btrfs?] kernel BUG in folio_unlock (2)

From: Hillf Danton
Date: Thu May 02 2024 - 19:23:49 EST


On Thu, 02 May 2024 09:24:30 -0700
> syzbot found the following issue on:
>
> HEAD commit: 9c6ecb3cb6e2 Add linux-next specific files for 20240502
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10efe5f8980000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 9c6ecb3cb6e2

--- x/fs/btrfs/extent_io.c
+++ y/fs/btrfs/extent_io.c
@@ -1516,7 +1516,8 @@ done:
PAGE_SIZE, !ret);
mapping_set_error(page->mapping, ret);
}
- unlock_page(page);
+ if (PageLocked(page))
+ unlock_page(page);
ASSERT(ret <= 0);
return ret;
}
--