{"push_id":1344661434,"size":5,"distinct_size":4,"ref":"refs/heads/misc-next","head":"a3fb6d0308d760564dd1972d19c5bf9d84242574","before":"4b78dab35f4ca80db652947b359997e8683f49f2","commits":[{"sha":"19c4d2f994788a954af1aa7e53b0fdb46fd7925a","author":{"name":"Chris Mason","email":"d794f69bf3a7f1879b8d1cc274910dff75cdf2eb@fb.com"},"message":"Revert \"btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs\"\n\nThis reverts commit 5d8eb6fe517583f9c6d5b94faf2254a0207a45c9.\n\nWhen we remove devices, we free the device structures.  Delaying\nbtfs_remove_chunk() ends up hitting a use-after-free on them.\n\nSigned-off-by: Chris Mason <clm@fb.com>","distinct":false,"url":"https://api.github.com/repos/kdave/btrfs-devel/commits/19c4d2f994788a954af1aa7e53b0fdb46fd7925a"},{"sha":"7a5461e0fbe3f345c4d012df8a03f6b8d71ffe63","author":{"name":"Wang Xiaoguang","email":"1eabe160327d2e4b22d174074e183aa7855bfff1@cn.fujitsu.com"},"message":"btrfs: fix WARNING in btrfs_select_ref_head()\n\nThis issue was found when testing in-band dedupe enospc behaviour,\nsometimes run_one_delayed_ref() may fail for enospc reason, then\n__btrfs_run_delayed_refs（）will return, but forget to add num_heads_read\nback, which will trigger \"WARN_ON(delayed_refs->num_heads_ready == 0)\" in\nbtrfs_select_ref_head().\n\nSigned-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>\nSigned-off-by: David Sterba <dsterba@suse.com>","distinct":true,"url":"https://api.github.com/repos/kdave/btrfs-devel/commits/7a5461e0fbe3f345c4d012df8a03f6b8d71ffe63"},{"sha":"3973fcd1b8f159dac8d9e26623f088b60d5b77c4","author":{"name":"Wang Xiaoguang","email":"1eabe160327d2e4b22d174074e183aa7855bfff1@cn.fujitsu.com"},"message":"btrfs: should block unused block groups deletion work when allocating data space\n\ncleaner_kthread() may run at any time, in which it'll call btrfs_delete_unused_bgs()\nto delete unused block groups. Because this work is asynchronous, it may also result\nin false ENOSPC error. Please see below race window:\n\n               CPU1                           |             CPU2\n                                              |\n|-> btrfs_alloc_data_chunk_ondemand()         |-> cleaner_kthread()\n    |-> do_chunk_alloc()                      |   |\n    |   assume it returns ENOSPC, which means |   |\n    |   btrfs_space_info is full and have free|   |\n    |   space to satisfy data request.        |   |\n    |                                         |   |- > btrfs_delete_unused_bgs()\n    |                                         |   |    it will decrease btrfs_space_info\n    |                                         |   |    total_bytes and make\n    |                                         |   |    btrfs_space_info is not full.\n    |                                         |   |\nIn this case, we may get ENOSPC error, but btrfs_space_info is not full.\n\nTo fix this issue, in btrfs_alloc_data_chunk_ondemand(), if we need to call\ndo_chunk_alloc() to allocating new chunk, we should block btrfs_delete_unused_bgs().\nHere we introduce a new struct rw_semaphore bg_delete_sem to do this job.\n\nIndeed there is already a \"struct mutex delete_unused_bgs_mutex\", but it's mutex,\nwe can not use it for this purpose. Of course, we can re-define it to be struct\nrw_semaphore, then use it in btrfs_alloc_data_chunk_ondemand(). Either method will\nwork.\n\nBut given that delete_unused_bgs_mutex's name length is longer than bg_delete_sem,\nI choose the first method, to create a new struct rw_semaphore bg_delete_sem and\ndelete delete_unused_bgs_mutex :)\n\nReported-by: Stefan Priebe <s.priebe@profihost.ag>\nSigned-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>\nSigned-off-by: David Sterba <dsterba@suse.com>","distinct":true,"url":"https://api.github.com/repos/kdave/btrfs-devel/commits/3973fcd1b8f159dac8d9e26623f088b60d5b77c4"},{"sha":"a3f185ddff50046f27613a4e8f5d8c47da5c3f50","author":{"name":"Wang Xiaoguang","email":"1eabe160327d2e4b22d174074e183aa7855bfff1@cn.fujitsu.com"},"message":"btrfs: fix false enospc error when truncating heavily reflinked file\n\nBelow test script can reveal this bug:\n    dd if=/dev/zero of=fs.img bs=$((1024*1024)) count=100\n    dev=$(losetup --show -f fs.img)\n    mkdir -p /mnt/mntpoint\n    mkfs.btrfs  -f $dev\n    mount $dev /mnt/mntpoint\n    cd /mnt/mntpoint\n\n    echo \"workdir is: /mnt/mntpoint\"\n    blocksize=$((128 * 1024))\n    dd if=/dev/zero of=testfile bs=$blocksize count=1\n    sync\n    count=$((17*1024*1024*1024/blocksize))\n    echo \"file size is:\" $((count*blocksize))\n    for ((i = 1; i <= $count; i++)); do\n        dst_offset=$((blocksize * i))\n        xfs_io -f -c \"reflink testfile 0 $dst_offset $blocksize\"\\\n                testfile > /dev/null\n    done\n    sync\n    truncate --size 0 testfile\n\nThe last truncate operation will fail for ENOSPC reason, but indeed\nit should not fail.\n\nIn btrfs_truncate(), we use a temporary block_rsv to do truncate\noperation. With every btrfs_truncate_inode_items() call, we migrate space\nto this block_rsv, but forget to cleanup previous reservation, which\nwill make this block_rsv's reserved bytes keep growing, and this reserved\nspace will only be released in the end of btrfs_truncate(), this metadata\nleak will impact other's metadata reservation. In this case, it's\n\"btrfs_start_transaction(root, 2);\" fails for enospc error, which make\nthis truncate operation fail.\n\nCall btrfs_block_rsv_release() to fix this bug.\n\nSigned-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>\nSigned-off-by: David Sterba <dsterba@suse.com>","distinct":true,"url":"https://api.github.com/repos/kdave/btrfs-devel/commits/a3f185ddff50046f27613a4e8f5d8c47da5c3f50"},{"sha":"a3fb6d0308d760564dd1972d19c5bf9d84242574","author":{"name":"Nikolay Borisov","email":"d73dc0ee41f8b02bae277090e92abc1675af05ac@kyup.com"},"message":"btrfs: Fix handling of -ENOENT from btrfs_uuid_iter_rem\n\nbtrfs_uuid_iter_rem is able to return -ENOENT, however this condition\nis not handled in btrfs_uuid_tree_iterate which can lead to calling\nbtrfs_next_item with freed path argument, leading to a null pointer\ndereference. Fix it by redoing the search but with an incremented\nobjectid so we don't loop over the same key.\n\nSigned-off-by: Nikolay Borisov <kernel@kyup.com>\nSuggested-by: Chris Mason <clm@fb.com>\nLink: https://lkml.kernel.org/r/57A473B0.2040203@kyup.com\nSigned-off-by: David Sterba <dsterba@suse.com>","distinct":true,"url":"https://api.github.com/repos/kdave/btrfs-devel/commits/a3fb6d0308d760564dd1972d19c5bf9d84242574"}]}
{"actor":{"display_login":"kdave"}}