Whamcloud - gitweb
LU-14729 osd-ldiskfs: fix to declare write commits 94/43994/4
authorWang Shilong <wshilong@ddn.com>
Mon, 14 Jun 2021 01:28:51 +0000 (09:28 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 21 Jun 2021 22:18:45 +0000 (22:18 +0000)
commit9810341a839c27b7a53cdc047e0395f8f906c4bf
tree6989cea498b1a10cfcebda205a2bb2af315b6b12
parentd0881dd6c4820704cab55b1ea521f09a3f8ba616
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.

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