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-6.9-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
"Two more fixes, both have some visible effects on user space:

- add check if quotas are enabled when passing qgroup inheritance
info, this affects snapper that could fail to create a snapshot

- do check for leaf/node flag WRITTEN earlier so that nodes are
completely validated before access, this used to be done by
integrity checker but it's been removed and left an unhandled case"

* tag 'for-6.9-rc7-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: make sure that WRITTEN is set on all metadata blocks
btrfs: qgroup: do not check qgroup inherit if qgroup is disabled

+18 -15
+2
fs/btrfs/qgroup.c
··· 3045 3045 struct btrfs_qgroup_inherit *inherit, 3046 3046 size_t size) 3047 3047 { 3048 + if (!btrfs_qgroup_enabled(fs_info)) 3049 + return 0; 3048 3050 if (inherit->flags & ~BTRFS_QGROUP_INHERIT_FLAGS_SUPP) 3049 3051 return -EOPNOTSUPP; 3050 3052 if (size < sizeof(*inherit) || size > PAGE_SIZE)
+15 -15
fs/btrfs/tree-checker.c
··· 1797 1797 return BTRFS_TREE_BLOCK_INVALID_LEVEL; 1798 1798 } 1799 1799 1800 + if (unlikely(!btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_WRITTEN))) { 1801 + generic_err(leaf, 0, "invalid flag for leaf, WRITTEN not set"); 1802 + return BTRFS_TREE_BLOCK_WRITTEN_NOT_SET; 1803 + } 1804 + 1800 1805 /* 1801 1806 * Extent buffers from a relocation tree have a owner field that 1802 1807 * corresponds to the subvolume tree they are based on. So just from an ··· 1863 1858 for (slot = 0; slot < nritems; slot++) { 1864 1859 u32 item_end_expected; 1865 1860 u64 item_data_end; 1861 + enum btrfs_tree_block_status ret; 1866 1862 1867 1863 btrfs_item_key_to_cpu(leaf, &key, slot); 1868 1864 ··· 1919 1913 return BTRFS_TREE_BLOCK_INVALID_OFFSETS; 1920 1914 } 1921 1915 1922 - /* 1923 - * We only want to do this if WRITTEN is set, otherwise the leaf 1924 - * may be in some intermediate state and won't appear valid. 1925 - */ 1926 - if (btrfs_header_flag(leaf, BTRFS_HEADER_FLAG_WRITTEN)) { 1927 - enum btrfs_tree_block_status ret; 1928 - 1929 - /* 1930 - * Check if the item size and content meet other 1931 - * criteria 1932 - */ 1933 - ret = check_leaf_item(leaf, &key, slot, &prev_key); 1934 - if (unlikely(ret != BTRFS_TREE_BLOCK_CLEAN)) 1935 - return ret; 1936 - } 1916 + /* Check if the item size and content meet other criteria. */ 1917 + ret = check_leaf_item(leaf, &key, slot, &prev_key); 1918 + if (unlikely(ret != BTRFS_TREE_BLOCK_CLEAN)) 1919 + return ret; 1937 1920 1938 1921 prev_key.objectid = key.objectid; 1939 1922 prev_key.type = key.type; ··· 1951 1956 int slot; 1952 1957 int level = btrfs_header_level(node); 1953 1958 u64 bytenr; 1959 + 1960 + if (unlikely(!btrfs_header_flag(node, BTRFS_HEADER_FLAG_WRITTEN))) { 1961 + generic_err(node, 0, "invalid flag for node, WRITTEN not set"); 1962 + return BTRFS_TREE_BLOCK_WRITTEN_NOT_SET; 1963 + } 1954 1964 1955 1965 if (unlikely(level <= 0 || level >= BTRFS_MAX_LEVEL)) { 1956 1966 generic_err(node, 0,
+1
fs/btrfs/tree-checker.h
··· 53 53 BTRFS_TREE_BLOCK_INVALID_BLOCKPTR, 54 54 BTRFS_TREE_BLOCK_INVALID_ITEM, 55 55 BTRFS_TREE_BLOCK_INVALID_OWNER, 56 + BTRFS_TREE_BLOCK_WRITTEN_NOT_SET, 56 57 }; 57 58 58 59 /*