Whamcloud - gitweb
LU-11101 quota: fix setattr project check 30/32730/6
authorWang Shilong <wshilong@ddn.com>
Wed, 17 Oct 2018 05:55:17 +0000 (13:55 +0800)
committerOleg Drokin <green@whamcloud.com>
Fri, 2 Nov 2018 07:17:38 +0000 (07:17 +0000)
commit2d3bbce0c9f3170e16eeeeb1cd29d3372d726260
tree3ad72d7e50f6ca62d6054900b2a3a121fcd5b300
parent8961f2d8e263c831ebebc47081d8e8ac61ffbcd9
LU-11101 quota: fix setattr project check

Similar patch motivated by upstream patch:
ext4: fix setattr project check in fssetxattr ioctl

Currently, project quota could be changed by fssetxattr
ioctl, and existed permission check inode_owner_or_capable()
is obviously not enough, just think that common users could
change project id of file, that could make users to
break project quota easily.

This patch try to follow same regular of xfs project
quota:

"Project Quota ID state is only allowed to change from
within the init namespace. Enforce that restriction only
if we are trying to change the quota ID state.
Everything else is allowed in user namespaces."

Test-Parameters: trivial testlist=sanity-quota,sanity-quota
Change-Id: If03bb120476eca9707b1b4db64e9594bb99df59e
Signed-off-by: Wang Shilong <wshilong@ddn.com>i
Reviewed-on: https://review.whamcloud.com/32730
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/tests/sanity-quota.sh