Whamcloud - gitweb
LU-13765 osd-ldiskfs: Extend credit correctly for fallocate 42/39342/18
authorArshad Hussain <arshad.super@gmail.com>
Wed, 9 Sep 2020 23:18:13 +0000 (04:48 +0530)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Oct 2020 04:28:42 +0000 (04:28 +0000)
commit93f700ca241a98630fc5ff19a041e35fbdbf0385
tree88a6d9367f5d46c41b65e7d2b019a7cddef1df13
parent6ae92a7f1bd94c8182c1cc05fad8d3c394c0d959
LU-13765 osd-ldiskfs: Extend credit correctly for fallocate

In OSD layer, before call ->fallocate(), Lustre has already
created journal handle for the fallocate transcation. In
ldiskfs/ext4, for very large range fallocate, the operation
may split into multiple transaction and call journal start/stop
multiple times inside fallocate. However, nested journal will
ignore requested credits, this result in running out of credits
at the end.

As we can not predict the total number of credits needed in
advance especially for large fallocate, thus in this patch, we
move fallocate logic into Lustre OSD, so that it could reserve
credits correctly. It extends credits for the current transaction
when found the left buffer credits is less than needed, and then
restart the transaction.

Testcase sanity/150e and sanity-quota/1h added to verify the
issue.

Test-Parameters: trivial testlist=sanity ostsizegb=12 env=ONLY="150e"
Test-Parameters: testlist=sanity-quota
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: Ib7565ed2c1ae72eef4832fbcb710e0ee70c53aec
Reviewed-on: https://review.whamcloud.com/39342
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/dt_object.h
lustre/ofd/ofd_objects.c
lustre/osd-ldiskfs/osd_io.c
lustre/osd-zfs/osd_io.c
lustre/tests/sanity-quota.sh
lustre/tests/sanity.sh