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

Pull btrfs fixes from Chris Mason:
"Josef fixed a problem when quotas are enabled with his latest ENOSPC
rework, and Jeff added more checks into the subvol ioctls to avoid
tripping up lookup_one_len"

* 'for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: ensure that file descriptor used with subvol ioctls is a dir
Btrfs: handle quota reserve failure properly

+15 -6
+3 -6
fs/btrfs/extent-tree.c
··· 4271 4271 if (ret < 0) 4272 4272 return ret; 4273 4273 4274 - /* 4275 - * Use new btrfs_qgroup_reserve_data to reserve precious data space 4276 - * 4277 - * TODO: Find a good method to avoid reserve data space for NOCOW 4278 - * range, but don't impact performance on quota disable case. 4279 - */ 4274 + /* Use new btrfs_qgroup_reserve_data to reserve precious data space. */ 4280 4275 ret = btrfs_qgroup_reserve_data(inode, start, len); 4276 + if (ret) 4277 + btrfs_free_reserved_data_space_noquota(inode, start, len); 4281 4278 return ret; 4282 4279 } 4283 4280
+12
fs/btrfs/ioctl.c
··· 1634 1634 int namelen; 1635 1635 int ret = 0; 1636 1636 1637 + if (!S_ISDIR(file_inode(file)->i_mode)) 1638 + return -ENOTDIR; 1639 + 1637 1640 ret = mnt_want_write_file(file); 1638 1641 if (ret) 1639 1642 goto out; ··· 1694 1691 struct btrfs_ioctl_vol_args *vol_args; 1695 1692 int ret; 1696 1693 1694 + if (!S_ISDIR(file_inode(file)->i_mode)) 1695 + return -ENOTDIR; 1696 + 1697 1697 vol_args = memdup_user(arg, sizeof(*vol_args)); 1698 1698 if (IS_ERR(vol_args)) 1699 1699 return PTR_ERR(vol_args); ··· 1719 1713 u64 *ptr = NULL; 1720 1714 bool readonly = false; 1721 1715 struct btrfs_qgroup_inherit *inherit = NULL; 1716 + 1717 + if (!S_ISDIR(file_inode(file)->i_mode)) 1718 + return -ENOTDIR; 1722 1719 1723 1720 vol_args = memdup_user(arg, sizeof(*vol_args)); 1724 1721 if (IS_ERR(vol_args)) ··· 2365 2356 int namelen; 2366 2357 int ret; 2367 2358 int err = 0; 2359 + 2360 + if (!S_ISDIR(dir->i_mode)) 2361 + return -ENOTDIR; 2368 2362 2369 2363 vol_args = memdup_user(arg, sizeof(*vol_args)); 2370 2364 if (IS_ERR(vol_args))