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 branch 'for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"I have two more bug fixes for btrfs.

My commit fixes a bug we hit last week at FB, a combination of lots of
hard links and an admin command to resolve inode numbers.

Dave is adding checks to make sure balance on current kernels ignores
filters it doesn't understand. The penalty for being wrong is just
doing more work (not crashing etc), but it's a good fix"

* 'for-linus-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: fix use after free iterating extrefs
btrfs: check unsupported filters in balance arguments

+16 -5
+3 -5
fs/btrfs/backref.c
··· 1828 1828 int found = 0; 1829 1829 struct extent_buffer *eb; 1830 1830 struct btrfs_inode_extref *extref; 1831 - struct extent_buffer *leaf; 1832 1831 u32 item_size; 1833 1832 u32 cur_offset; 1834 1833 unsigned long ptr; ··· 1855 1856 btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK); 1856 1857 btrfs_release_path(path); 1857 1858 1858 - leaf = path->nodes[0]; 1859 - item_size = btrfs_item_size_nr(leaf, slot); 1860 - ptr = btrfs_item_ptr_offset(leaf, slot); 1859 + item_size = btrfs_item_size_nr(eb, slot); 1860 + ptr = btrfs_item_ptr_offset(eb, slot); 1861 1861 cur_offset = 0; 1862 1862 1863 1863 while (cur_offset < item_size) { ··· 1870 1872 if (ret) 1871 1873 break; 1872 1874 1873 - cur_offset += btrfs_inode_extref_name_len(leaf, extref); 1875 + cur_offset += btrfs_inode_extref_name_len(eb, extref); 1874 1876 cur_offset += sizeof(*extref); 1875 1877 } 1876 1878 btrfs_tree_read_unlock_blocking(eb);
+5
fs/btrfs/ioctl.c
··· 4639 4639 bctl->flags |= BTRFS_BALANCE_TYPE_MASK; 4640 4640 } 4641 4641 4642 + if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) { 4643 + ret = -EINVAL; 4644 + goto out_bargs; 4645 + } 4646 + 4642 4647 do_balance: 4643 4648 /* 4644 4649 * Ownership of bctl and mutually_exclusive_operation_running
+8
fs/btrfs/volumes.h
··· 376 376 #define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4) 377 377 #define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5) 378 378 379 + #define BTRFS_BALANCE_ARGS_MASK \ 380 + (BTRFS_BALANCE_ARGS_PROFILES | \ 381 + BTRFS_BALANCE_ARGS_USAGE | \ 382 + BTRFS_BALANCE_ARGS_DEVID | \ 383 + BTRFS_BALANCE_ARGS_DRANGE | \ 384 + BTRFS_BALANCE_ARGS_VRANGE | \ 385 + BTRFS_BALANCE_ARGS_LIMIT) 386 + 379 387 /* 380 388 * Profile changing flags. When SOFT is set we won't relocate chunk if 381 389 * it already has the target profile (even though it may be