From 7c75006ad18c4e6f248f513f06b854b2c55362cb Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 10 Aug 2006 08:39:51 +0000 Subject: [PATCH] 1)for Non Create revalidate, we still should pack the child fid. for checking dentry stale. 2)we only check stale, if it do not create object in server. --- lustre/llite/dcache.c | 12 +++++++----- lustre/mdc/mdc_locks.c | 5 ++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index ff54e9f..5550aa9 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -373,20 +373,22 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, if (op_data == NULL) RETURN(-ENOMEM); - ll_prepare_md_op_data(op_data, parent, NULL, - de->d_name.name, de->d_name.len, 0); - if (it->it_op & IT_CREAT || - (it->it_op & IT_OPEN && it->it_create_mode & O_CREAT)) { + if (it->it_op & IT_CREAT) { struct lu_placement_hint hint = { .ph_pname = NULL, .ph_cname = &de->d_name, .ph_opc = LUSTRE_OPC_CREATE }; + ll_prepare_md_op_data(op_data, parent, NULL, + de->d_name.name, de->d_name.len, 0); rc = ll_fid_md_alloc(ll_i2sbi(parent), &op_data->fid2, &hint); if (rc) { CERROR("can't allocate new fid, rc %d\n", rc); LBUG(); } + } else { + ll_prepare_md_op_data(op_data, parent, de->d_inode, + de->d_name.name, de->d_name.len, 0); } rc = md_intent_lock(exp, op_data, NULL, 0, it, lookup_flags, @@ -409,7 +411,7 @@ int ll_revalidate_it(struct dentry *de, int lookup_flags, rc = ll_revalidate_it_finish(req, 1, it, de); if (rc != 0) { - if (rc != -ESTALE) + if (rc != -ESTALE && rc != -ENOENT) ll_intent_release(it); GOTO(out, rc = 0); } diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index e301c62..2513771 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -682,9 +682,8 @@ int mdc_intent_lock(struct obd_export *exp, struct md_op_data *op_data, !(it->it_op & IT_GETATTR)) { it_set_disposition(it, DISP_ENQ_COMPLETE); /* Also: did we find the same inode? */ - if (!(it->it_create_mode & O_CREAT || it->it_op & IT_CREAT) - && memcmp(&op_data->fid2, &mdt_body->fid1, - sizeof(op_data->fid2))) + if (!(it->it_op & IT_CREAT) && memcmp(&op_data->fid2, + &mdt_body->fid1, sizeof(op_data->fid2))) RETURN(-ESTALE); } -- 1.8.3.1