Whamcloud - gitweb
LU-14729 osd-ldiskfs: fix to declare write commits
authorWang Shilong <wshilong@ddn.com>
Mon, 14 Jun 2021 01:28:51 +0000 (09:28 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 21 Jul 2021 07:11:55 +0000 (07:11 +0000)
commitd9bd183ca0765808a347b5e1542fbeff01806852
tree8bd0e483ea6d38042854a05054565d96323b0abf
parent022a0994956fef2532a68cf3b2bda25238cd6bd1
LU-14729 osd-ldiskfs: fix to declare write commits

Fallocation might introduce unwritten extents, writting
data will trigger extents split, so we should reserve
credits for this case, to avoid complicated calculation,
we just use normal credits calculation if extent is mapped
as unwritten.

See comments in ext4:
If we add a single extent, then in the worse case, each tree
level index/leaf need to be changed in case of the tree split.
If more extents are inserted, they could cause the whole tree
split more than once, but this is really rare.

Lustre always reserve extents in 1 extent case, this is wrong.
Also fix indirect blocks calculation.

Lustre-change: https://review.whamcloud.com/43994
Lustre-commit: 9810341a839c27b7a53cdc047e0395f8f906c4bf

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I9b67ec7b002711f040f46d0c77a645bb6f57a7de
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/44280
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c