Whamcloud - gitweb
LU-5152 quota: enforce block quota for chgrp 46/30146/23
authorHongchao Zhang <hongchao.zhang@intel.com>
Sat, 27 Jan 2018 21:21:35 +0000 (05:21 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 6 Feb 2018 04:27:53 +0000 (04:27 +0000)
commit8a71fd5061bd073e055e6cbba1d238305e6827bb
tree8e54f7815fcd2061c99b114d5368078e23ad9710
parenta6fb2bbe71efcb07265ced337d2792626e2d9bbe
LU-5152 quota: enforce block quota for chgrp

When an unprivileged user calls chgrp to change the group
of one of his files, the block quota limit of that new group
should be checked to ensure it not exceeds the limit.

The side effect of this patch could be,
1.The performance of chgrp from non-privileged user will be
very slow, no matter if quota is enabled. Since we assume that
chgrp issued from non-privileged user is very rare, the performance
impact possibly is acceptable.
2.If MDT crash while performing chgrp, inconsistency (group ownership
among MDT and OST objects) will be created. It should be acceptable.

This patch has fixed the bug while calculating the disk space of
some file for ldiskfs and zfs, the block unit is always 512.

Change-Id: I4b781e94493fe63c8cbd5700dc68293b2504c2ac
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: https://review.whamcloud.com/30146
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/mdd/mdd_object.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_object.c
lustre/osp/osp_object.c
lustre/quota/qsd_handler.c
lustre/target/out_lib.c
lustre/tests/sanity-quota.sh