From 66bff4ade42c427d7b301e90f0e0cbe88db2ce27 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Tue, 16 Aug 2016 16:18:33 -0400 Subject: [PATCH] staging: lustre: llite: enable clients to inject error for lfsck This enables the client to inject an error by altering the parent FID in order to test if the server side file system checker behaves properly. Signed-off-by: Fan Yong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3951 Reviewed-on: http://review.whamcloud.com/7667 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/include/obd_support.h | 1 + drivers/staging/lustre/lustre/llite/vvp_req.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 845e64a5..71bf844 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -474,6 +474,7 @@ extern char obd_jobid_var[]; #define OBD_FAIL_LFSCK_CRASH 0x160a #define OBD_FAIL_LFSCK_NO_AUTO 0x160b #define OBD_FAIL_LFSCK_NO_DOUBLESCAN 0x160c +#define OBD_FAIL_LFSCK_INVALID_PFID 0x1619 /* UPDATE */ #define OBD_FAIL_UPDATE_OBJ_NET 0x1700 diff --git a/drivers/staging/lustre/lustre/llite/vvp_req.c b/drivers/staging/lustre/lustre/llite/vvp_req.c index 9fe9d6c..0567a15 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_req.c +++ b/drivers/staging/lustre/lustre/llite/vvp_req.c @@ -83,6 +83,8 @@ static void vvp_req_attr_set(const struct lu_env *env, } obdo_from_inode(oa, inode, valid_flags & flags); obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid); + if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID)) + oa->o_parent_oid++; memcpy(attr->cra_jobid, ll_i2info(inode)->lli_jobid, JOBSTATS_JOBID_SIZE); } -- 2.7.4