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

Pull btrfs fixes from David Sterba:

- two fixes preventing deletion and manual creation of subvolume qgroup

- unify error code returned for unknown send flags

- fix assertion during subvolume creation when anonymous device could
be allocated by other thread (e.g. due to backref walk)

* tag 'for-6.8-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: do not ASSERT() if the newly created subvolume already got read
btrfs: forbid deleting live subvol qgroup
btrfs: forbid creating subvol qgroups
btrfs: send: return EOPNOTSUPP on unknown flags

+31 -3
+11 -2
fs/btrfs/disk-io.c
··· 1336 1336 again: 1337 1337 root = btrfs_lookup_fs_root(fs_info, objectid); 1338 1338 if (root) { 1339 - /* Shouldn't get preallocated anon_dev for cached roots */ 1340 - ASSERT(!anon_dev); 1339 + /* 1340 + * Some other caller may have read out the newly inserted 1341 + * subvolume already (for things like backref walk etc). Not 1342 + * that common but still possible. In that case, we just need 1343 + * to free the anon_dev. 1344 + */ 1345 + if (unlikely(anon_dev)) { 1346 + free_anon_bdev(anon_dev); 1347 + anon_dev = 0; 1348 + } 1349 + 1341 1350 if (check_ref && btrfs_root_refs(&root->root_item) == 0) { 1342 1351 btrfs_put_root(root); 1343 1352 return ERR_PTR(-ENOENT);
+5
fs/btrfs/ioctl.c
··· 3815 3815 goto out; 3816 3816 } 3817 3817 3818 + if (sa->create && is_fstree(sa->qgroupid)) { 3819 + ret = -EINVAL; 3820 + goto out; 3821 + } 3822 + 3818 3823 trans = btrfs_join_transaction(root); 3819 3824 if (IS_ERR(trans)) { 3820 3825 ret = PTR_ERR(trans);
+14
fs/btrfs/qgroup.c
··· 1736 1736 return ret; 1737 1737 } 1738 1738 1739 + static bool qgroup_has_usage(struct btrfs_qgroup *qgroup) 1740 + { 1741 + return (qgroup->rfer > 0 || qgroup->rfer_cmpr > 0 || 1742 + qgroup->excl > 0 || qgroup->excl_cmpr > 0 || 1743 + qgroup->rsv.values[BTRFS_QGROUP_RSV_DATA] > 0 || 1744 + qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PREALLOC] > 0 || 1745 + qgroup->rsv.values[BTRFS_QGROUP_RSV_META_PERTRANS] > 0); 1746 + } 1747 + 1739 1748 int btrfs_remove_qgroup(struct btrfs_trans_handle *trans, u64 qgroupid) 1740 1749 { 1741 1750 struct btrfs_fs_info *fs_info = trans->fs_info; ··· 1761 1752 qgroup = find_qgroup_rb(fs_info, qgroupid); 1762 1753 if (!qgroup) { 1763 1754 ret = -ENOENT; 1755 + goto out; 1756 + } 1757 + 1758 + if (is_fstree(qgroupid) && qgroup_has_usage(qgroup)) { 1759 + ret = -EBUSY; 1764 1760 goto out; 1765 1761 } 1766 1762
+1 -1
fs/btrfs/send.c
··· 8111 8111 } 8112 8112 8113 8113 if (arg->flags & ~BTRFS_SEND_FLAG_MASK) { 8114 - ret = -EINVAL; 8114 + ret = -EOPNOTSUPP; 8115 8115 goto out; 8116 8116 } 8117 8117