On Friday, June 24, 2016 10:50:41 AM Qu Wenruo wrote:
> Hi Chandan, David,
>
> When I'm trying to rebase dedupe patchset on top of Chadan's sub page
> size patchset (using David's for-next-test-20160620), although the
> rebase itself is quite simple, but I'm afraid that I found some bugs for
> sub page size patchset, *without* dedupe patchset applied.
>
> These bugs seems to be unrelated to each other
> 1) state leak at btrfs rmmod time
> 2) bytes_may_use leak at qgroup EDQUOTA error time
> 3) selftest is run several times at modules load time
> 15 times, to be more exact
> And since I didn't found any immediate number related to run it 15
> times, I assume at least it's not designed to do it 15 times.
>
Ah, In btrfs_run_sanity_tests(), just after,
for (i = 0; i < ARRAY_SIZE(test_sectorsize); i++) {
sectorsize = test_sectorsize[i];
I missed out on adding "if (sectorsize > PAGE_SIZE) break;". I will fix this
up in the next post of the patchset. Thanks for pointing this out.
> The reproducer for 1) and 2) is quite simple, extracted from btrfs/022
> test case:
> ------
> dev=/dev/sdb5
> mnt=/mnt/test
>
> umount $dev &> /dev/null
>
> mkfs.btrfs $dev -f
> mount $dev $mnt -o nospace_cache
> btrfs dedupe enable $mnt
> btrfs sub create $mnt/sub
> btrfs quota enable $mnt
>
>
> # Just use small limit, making ftrace less noise.
> btrfs qgroup limit 512K 0/257 $mnt
> dd if=/dev/urandom of=$mnt/sub/test bs=1M count=1
> umount $mnt
> rmmod btrfs
> ------
>
> At unmount time, kernel warning will happen due to may_use bytes leak.
> I could dig it further, as it looks like a bug in space reservation
> failure case.
> ------
> BTRFS: space_info 1 has 8044544 free, is not full
> BTRFS: space_info total=8388608, used=344064, pinned=0, reserved=0,
> may_use=409600, readonly=0
> ------
>
> And at rmmod time, btrfs will detect extent_state leak, whose length is
> always 4095 (page size - 1).
>
Qu, I will investigate and fix this issue. And thanks a lot for the
reproducer test.
--
chandan
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html