From bee803c6e440ba6b55e0ff356e5324f44cfa63eb Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Fri, 29 Jul 2022 16:35:41 +1000 Subject: [PATCH] LU-16057 obdclass: set OBD_MD_FLGROUP for ladvise RPC ladvise RPC doesn't have OBD_MD_FLGROUP set, when RPC reaches server, tgt_validate_obdo() will corrupt the FID if it's seq is in FID_SEQ_NORMAL range. Do not mess with seq in obdo_to_ioobj() and tgt_validate_obdo(), since 2.0 all RPCs should have OBD_MD_FLGROUP set. Add OBD_MD_FLGROUP for ladvise RPC to fix new client talking to old servers. Change-Id: I373b7f32458b18e29d9bb716a912fe4a54eccac5 Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/48080 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/obdclass/obdo.c | 3 --- lustre/osc/osc_io.c | 2 +- lustre/target/tgt_handler.c | 5 +---- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lustre/obdclass/obdo.c b/lustre/obdclass/obdo.c index d17d197..b1d7337 100644 --- a/lustre/obdclass/obdo.c +++ b/lustre/obdclass/obdo.c @@ -164,9 +164,6 @@ EXPORT_SYMBOL(obdo_cpy_md); void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj) { ioobj->ioo_oid = oa->o_oi; - if (unlikely(!(oa->o_valid & OBD_MD_FLGROUP))) - ostid_set_seq_mdt0(&ioobj->ioo_oid); - /* * Since 2.4 this does not contain o_mode in the low 16 bits. * Instead, it holds (bd_md_max_brw - 1) for multi-bulk BRW RPCs diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index fec986e..46a9ced 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -1048,7 +1048,7 @@ static int osc_io_ladvise_start(const struct lu_env *env, memset(oa, 0, sizeof(*oa)); oa->o_oi = loi->loi_oi; - oa->o_valid = OBD_MD_FLID; + oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP; obdo_set_parent_fid(oa, lio->li_fid); ladvise = ladvise_hdr->lah_advise; diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index d0be636..67a6b73 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -157,11 +157,8 @@ int tgt_validate_obdo(struct tgt_session_info *tsi, struct obdo *oa) /* Note: this check might be forced in 2.5 or 2.6, i.e. * all of the requests are required to setup FLGROUP */ - if (unlikely(!(oa->o_valid & OBD_MD_FLGROUP))) { - ostid_set_seq_mdt0(oi); + if (unlikely(!(oa->o_valid & OBD_MD_FLGROUP))) oa->o_valid |= OBD_MD_FLGROUP; - seq = ostid_seq(oi); - } if (unlikely(!(fid_seq_is_idif(seq) || fid_seq_is_mdt0(seq) || fid_seq_is_norm(seq) || fid_seq_is_echo(seq)))) -- 1.8.3.1