Whamcloud - gitweb
LU-9874 osd-ldiskfs: simplify project transfer codes 97/32297/4
authorWang Shilong <wshilong@ddn.com>
Tue, 27 Jun 2017 05:51:09 +0000 (13:51 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 19 Jan 2019 06:28:44 +0000 (06:28 +0000)
commit53cde2399719b56817bca26d6895a114a6feed1d
treedca70ac8565e7c54253be54ccb0c0d551f59e574
parentf9f2325146cee63ff1501479f720f9711538122a
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.

Lustre-commit: a9d3c9ba5360f46b2eaa5732a98c0ee836a927df
Lustre-change: https://review.whamcloud.com/28510

Change-Id: I6ab3c0fdc4cf456b102e49d9326840fd0e12ade0
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Bob Glossman <bob.glossman@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>
Reviewed-on: https://review.whamcloud.com/32297
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldiskfs/kernel_patches/patches/rhel7.5/ext4-projid-xfs-ioctls.patch
ldiskfs/kernel_patches/patches/rhel7/ext4-projid-xfs-ioctls.patch
lustre/osd-ldiskfs/osd_handler.c