Whamcloud - gitweb
LU-14729 osd-ldiskfs: fix to declare write commits 07/45507/2
authorWang Shilong <wshilong@ddn.com>
Mon, 14 Jun 2021 01:28:51 +0000 (09:28 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 14 Nov 2021 03:11:16 +0000 (03:11 +0000)
commitf9c06dc07cc6c2125a014f472bba8f6022b660ac
treea4d196d3e403681cf61599f0b3fc71cf573e7a01
parent8e1e4194258ba83ecba2e4ed5c1d19a79faf28c4
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/45507
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osd-ldiskfs/osd_io.c