Whamcloud - gitweb
LU-16057 obdclass: set OBD_MD_FLGROUP for ladvise RPC 80/48080/2
authorLi Dongyang <dongyangli@ddn.com>
Fri, 29 Jul 2022 06:35:41 +0000 (16:35 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 24 Sep 2022 20:28:10 +0000 (20:28 +0000)
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 <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/48080
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obdo.c
lustre/osc/osc_io.c
lustre/target/tgt_handler.c

index d17d197..b1d7337 100644 (file)
@@ -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
index fec986e..46a9ced 100644 (file)
@@ -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;
index d0be636..67a6b73 100644 (file)
@@ -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))))