From 85c25e844fd8253b124255aaecce4c2f58ab8498 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 21 Sep 2005 21:14:26 +0000 Subject: [PATCH] - generate capability in open resend case - regression test for the case --- lustre/mds/mds_open.c | 11 ++++++++++- lustre/tests/replay-single.sh | 13 +++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index f00cac4..4790488 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -622,6 +622,15 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, /* get lock (write for O_CREAT, read otherwise) */ mds_pack_inode2body(obd, body, dchild->d_inode, 1); if (S_ISREG(dchild->d_inode->i_mode)) { + struct lustre_capa capa = { + .lc_uid = rec->ur_uc.luc_uid, + .lc_op = capa_op(rec->ur_flags), + .lc_ino = dchild->d_inode->i_ino, + .lc_igen = dchild->d_inode->i_generation, + .lc_mdsid = mds->mds_num, + }; + int off = 7; /* capa offset */ + rc = mds_pack_md(obd, req->rq_repmsg, 2, body, dchild->d_inode, 1, 0); @@ -632,7 +641,7 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, if (!(body->valid & OBD_MD_FLEASIZE)) body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME | OBD_MD_FLMTIME); - DEBUG_REQ(D_ERROR, req, "no capa for "DLID4, OLID4(&body->id1)); + rc = mds_pack_capa(obd, med, NULL, &capa, req, &off, body); } /* If we have -EEXIST as the status, and we were asked to create diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 742c114..06e2ab6 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -1313,6 +1313,19 @@ test_57() { } run_test 57 "open orphan in reconstruct_open()" +test_58() { + capa=`cat /proc/fs/lustre/mds/mds*/capa` + if [ "$capa" == "0" ]; then + echo "skip testing - no capa enabled" + return 0 + fi + sysctl -w lustre.fail_loc=0x0000030c + rc=multiop $DIR/$tfile Ow + sysctl -w lustre.fail_loc=0 + return rc +} +run_test 58 "open+create resent should return capa" + equals_msg test complete, cleaning up $CLEANUP -- 1.8.3.1