Whamcloud - gitweb
LU-9874 osd-ldiskfs: simplify project transfer codes 10/28510/4
authorWang Shilong <wshilong@ddn.com>
Tue, 27 Jun 2017 05:51:09 +0000 (13:51 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 28 Aug 2017 06:27:09 +0000 (06:27 +0000)
commita9d3c9ba5360f46b2eaa5732a98c0ee836a927df
treea2b175d17e4e0859986f86c878f7a0a49183d1dc
parent31b4e842698fce2ebf607b13a0989ace552aa64d
LU-9874 osd-ldiskfs: simplify project transfer codes

Currently, osd-ldiskfs call __ldiskfs_ioctl_project()
to transfer project quota which is user ioctl for ext4 which
will start a transaction, and reserve credits, this is not
right logic with Lustre.

Lustre have started a transaction handle and credits should be
reserved during declare phase, so calling _ldiskfs_ioctl_project()
here will cause nested handle starting, which is not a problem for
JBD2 because it will attach current thread's handle if transaction
have been started, but in this case it will ignore credits
reservation.

Also Lustre don't need inode mutex protection for
project transfer, we don't need write inode in transfer codes,
it will be done when dirty inode is called. Setting attr
have reserved enough credits for project transfer, we need
fix agent inode transfering.

This patch makes codes logic clear, also fix credits
reservation for DNE agent inode transfering.

Change-Id: I6ab3c0fdc4cf456b102e49d9326840fd0e12ade0
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/28510
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
ldiskfs/kernel_patches/patches/rhel7/ext4-projid-xfs-ioctls.patch
lustre/osd-ldiskfs/osd_handler.c