diff mbox series

[02/20] lustre: obdclass: set OBD_MD_FLGROUP for ladvise RPC

Message ID 1665783491-13827-3-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: backport OpenSFS work as of Oct 14, 2022 | expand

Commit Message

James Simmons Oct. 14, 2022, 9:37 p.m. UTC
From: Li Dongyang <dongyangli@ddn.com>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16057
Lustre-commit: bee803c6e440ba6b5 ("LU-16057 obdclass: set OBD_MD_FLGROUP for ladvise RPC")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/48080
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/obdclass/obdo.c | 3 ---
 fs/lustre/osc/osc_io.c    | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/obdclass/obdo.c b/fs/lustre/obdclass/obdo.c
index 7df4ff399890..9cafda16a95f 100644
--- a/fs/lustre/obdclass/obdo.c
+++ b/fs/lustre/obdclass/obdo.c
@@ -123,9 +123,6 @@  EXPORT_SYMBOL(obdo_from_inode);
 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/fs/lustre/osc/osc_io.c b/fs/lustre/osc/osc_io.c
index 655c7c68ab3a..4c9b3d2bb481 100644
--- a/fs/lustre/osc/osc_io.c
+++ b/fs/lustre/osc/osc_io.c
@@ -1036,7 +1036,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;