Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-5.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into master

Pull btrfs fixes from David Sterba:
"A few resouce leak fixes from recent patches, all are stable material.

The problems have been observed during testing or have a reproducer"

* tag 'for-5.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: fix mount failure caused by race with umount
btrfs: fix page leaks after failure to lock page for delalloc
btrfs: qgroup: fix data leak caused by race between writeback and truncate
btrfs: fix double free on ulist after backref resolution failure

+21 -14
+1
fs/btrfs/backref.c
··· 1461 1461 if (ret < 0 && ret != -ENOENT) { 1462 1462 ulist_free(tmp); 1463 1463 ulist_free(*roots); 1464 + *roots = NULL; 1464 1465 return ret; 1465 1466 } 1466 1467 node = ulist_next(tmp, &uiter);
+2 -1
fs/btrfs/extent_io.c
··· 1999 1999 if (!PageDirty(pages[i]) || 2000 2000 pages[i]->mapping != mapping) { 2001 2001 unlock_page(pages[i]); 2002 - put_page(pages[i]); 2002 + for (; i < ret; i++) 2003 + put_page(pages[i]); 2003 2004 err = -EAGAIN; 2004 2005 goto out; 2005 2006 }
+10 -13
fs/btrfs/inode.c
··· 8123 8123 /* 8124 8124 * Qgroup reserved space handler 8125 8125 * Page here will be either 8126 - * 1) Already written to disk 8127 - * In this case, its reserved space is released from data rsv map 8128 - * and will be freed by delayed_ref handler finally. 8129 - * So even we call qgroup_free_data(), it won't decrease reserved 8130 - * space. 8131 - * 2) Not written to disk 8132 - * This means the reserved space should be freed here. However, 8133 - * if a truncate invalidates the page (by clearing PageDirty) 8134 - * and the page is accounted for while allocating extent 8135 - * in btrfs_check_data_free_space() we let delayed_ref to 8136 - * free the entire extent. 8126 + * 1) Already written to disk or ordered extent already submitted 8127 + * Then its QGROUP_RESERVED bit in io_tree is already cleaned. 8128 + * Qgroup will be handled by its qgroup_record then. 8129 + * btrfs_qgroup_free_data() call will do nothing here. 8130 + * 8131 + * 2) Not written to disk yet 8132 + * Then btrfs_qgroup_free_data() call will clear the QGROUP_RESERVED 8133 + * bit of its io_tree, and free the qgroup reserved data space. 8134 + * Since the IO will never happen for this page. 8137 8135 */ 8138 - if (PageDirty(page)) 8139 - btrfs_qgroup_free_data(inode, NULL, page_start, PAGE_SIZE); 8136 + btrfs_qgroup_free_data(inode, NULL, page_start, PAGE_SIZE); 8140 8137 if (!inode_evicting) { 8141 8138 clear_extent_bit(tree, page_start, page_end, EXTENT_LOCKED | 8142 8139 EXTENT_DELALLOC | EXTENT_DELALLOC_NEW |
+8
fs/btrfs/volumes.c
··· 7052 7052 mutex_lock(&fs_info->chunk_mutex); 7053 7053 7054 7054 /* 7055 + * It is possible for mount and umount to race in such a way that 7056 + * we execute this code path, but open_fs_devices failed to clear 7057 + * total_rw_bytes. We certainly want it cleared before reading the 7058 + * device items, so clear it here. 7059 + */ 7060 + fs_info->fs_devices->total_rw_bytes = 0; 7061 + 7062 + /* 7055 7063 * Read all device items, and then all the chunk items. All 7056 7064 * device items are found before any chunk item (their object id 7057 7065 * is smaller than the lowest possible object id for a chunk