Whamcloud - gitweb
LU-17048 mdd: protect layout change in MDD layer
authorBobi Jam <bobijam@whamcloud.com>
Mon, 28 Aug 2023 13:08:34 +0000 (21:08 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 6 Jan 2024 08:21:43 +0000 (08:21 +0000)
commitbe89bacf76840b0afd8fd9d96dc410a3e5951ef3
tree3d447d99a12aac6a33bbabe4726ba06eb1867155
parente0d1152dcc7ea9ba6f191e53af0f7db12c5e90e6
LU-17048 mdd: protect layout change in MDD layer

We need to detect changes to the LOD layout in between transaction
declaration and when the objects are locked during transaction
execution. Otherwise, if another thread has modified the layout
of an object used by the transaction then the declaration may
be incorrect.

This patch save objects' layout generation in transaction delaration
phase, and check whether they have been changed by others in the
transaction execution phase, if that's the case, the transaction will
be retried for several times.

Lustre-change: https://review.whamcloud.com/52146
Lustre-commit: d5ab62af24166529b84b4d7227b96d3a69989a95

Fixes: b7bd4e3422 ("LU-14621 mdd: fix lock-tx order in mdd_xattr_merge()")
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I25fe03c6e8fc4eebccc039e62dfc88db1179cb26
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53567
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/lod/lod_dev.c
lustre/lod/lod_internal.h
lustre/lod/lod_object.c
lustre/mdd/mdd_dir.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c