]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Misc fixes and cleanup for project quota
authorNasf-Fan <fan.yong@intel.com>
Mon, 5 Mar 2018 20:56:27 +0000 (04:56 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 5 Mar 2018 20:56:27 +0000 (12:56 -0800)
commit2705ebf0a74f15bb246fb899f19b0ee17aa1c4b5
tree8ba5896d7bcf69891d85dadec737631aaa7d6e2e
parentdd3e1e3083e6b80ac7cc4dabfbf9b5036b7a889d
Misc fixes and cleanup for project quota

1) The Coverity Scan reports some issues for the project
   quota patch, including:

1.1) zfs_prop_get_userquota() directly uses the const quota
   type value as the condition check by wrong.

1.2) dmu_objset_userquota_get_ids() may cause dnode::dn_newgid
   to be overwritten by dnode::dn->dn_oldprojid.

2) This patch fixes related issues. It also enhances the logic
   for zfs_project_item_alloc() to avoid buffer overflow.

3) Skip project quota ability check if does not change project
   quota related things (id or flag). Otherwise, it will cause
   chattr (for other non project quota flags) operation failed
   if project quota disabled.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Fan Yong <fan.yong@intel.com>
Closes #7251
Closes #7265
cmd/zfs/zfs_project.c
lib/libzfs/libzfs_dataset.c
module/zfs/dmu_objset.c
module/zfs/zfs_vnops.c