Whamcloud - gitweb
LU-17048 mdd: protect layout change in MDD layer 46/52146/17
authorBobi Jam <bobijam@whamcloud.com>
Mon, 28 Aug 2023 13:08:34 +0000 (21:08 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 20 Dec 2023 01:43:42 +0000 (01:43 +0000)
commitd5ab62af24166529b84b4d7227b96d3a69989a95
tree295faf0feaa2ca6803e9e84c76c3c59cf94a575e
parent1fceff05d85d41c104b44995ebd3bf4075df4126
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.

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-on: https://review.whamcloud.com/c/fs/lustre-release/+/52146
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@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