Re: [PATCH] btrfs: Fix possible NULL pointer dereference in btrfs selftest

2019-02-28 Thread Qu Wenruo
On 2019/3/1 上午12:02, David Sterba wrote: > On Fri, Feb 22, 2019 at 08:53:50AM +0800, Qu Wenruo wrote: >> When CONFIG_BTRFS_FS_RUN_SANITY_TESTS is enabled, btrfs will run >> selftest at module load time. >> >> During selftest, we allocate extent buffer using >> alloc_test_extent_buffer(), instead

Re: [PATCH] btrfs: Fix possible NULL pointer dereference in btrfs selftest

2019-02-28 Thread David Sterba
On Fri, Feb 22, 2019 at 08:53:50AM +0800, Qu Wenruo wrote: > When CONFIG_BTRFS_FS_RUN_SANITY_TESTS is enabled, btrfs will run > selftest at module load time. > > During selftest, we allocate extent buffer using > alloc_test_extent_buffer(), instead of alloc_test_extent_buffer(). > > The problem i

Re: [PATCH] btrfs: Fix possible NULL pointer dereference in btrfs selftest

2019-02-21 Thread Qu Wenruo
On 2019/2/22 下午3:00, Dan Carpenter wrote: > I'm sorry, I feel bad for passing this work on to you when you didn't > introduce the problems at all. No problem at all. Who doesn't like to send out clean up patches? > > I think you're doing to the right thing to change it all to error > pointers

Re: [PATCH] btrfs: Fix possible NULL pointer dereference in btrfs selftest

2019-02-21 Thread Dan Carpenter
I'm sorry, I feel bad for passing this work on to you when you didn't introduce the problems at all. I think you're doing to the right thing to change it all to error pointers, and most of callers expect that but there are a couple that need to be changed: btrfs_test_qgroups() and run_test(). re

[PATCH] btrfs: Fix possible NULL pointer dereference in btrfs selftest

2019-02-21 Thread Qu Wenruo
When CONFIG_BTRFS_FS_RUN_SANITY_TESTS is enabled, btrfs will run selftest at module load time. During selftest, we allocate extent buffer using alloc_test_extent_buffer(), instead of alloc_test_extent_buffer(). The problem is, unlike alloc_extent_buffer(), alloc_test_extent_buffer() can return NU