Whamcloud - gitweb
Backout changes made to day in efforts to make test 41 work. It passes with
authorbrian <brian>
Sat, 24 Sep 2005 03:06:38 +0000 (03:06 +0000)
committerbrian <brian>
Sat, 24 Sep 2005 03:06:38 +0000 (03:06 +0000)
code checked out prior to all of these changes.

lustre/include/linux/obd.h
lustre/mds/handler.c
lustre/mds/mds_internal.h
lustre/mds/mds_lov.c
lustre/mds/mds_open.c

index d6dd380..a401829 100644 (file)
@@ -478,7 +478,6 @@ struct mds_obd {
         int                              mds_capa_key_idx;  /* the red key index */
         struct file                     *mds_capa_keys_filp;
         unsigned long                    mds_capa_key_timeout; /* sec */
         int                              mds_capa_key_idx;  /* the red key index */
         struct file                     *mds_capa_keys_filp;
         unsigned long                    mds_capa_key_timeout; /* sec */
-        unsigned                         mds_config_generation;
 };
 
 struct echo_obd {
 };
 
 struct echo_obd {
index 7dadf25..02b8d22 100644 (file)
@@ -1456,7 +1456,6 @@ int mds_getattr_size(struct obd_device *obd, struct dentry *dentry,
                      struct ptlrpc_request *req, struct mds_body *body)
 {
         struct inode *inode = dentry->d_inode;
                      struct ptlrpc_request *req, struct mds_body *body)
 {
         struct inode *inode = dentry->d_inode;
-        struct mds_obd *mds = &obd->u.mds;
         ENTRY;
 
         LASSERT(body != NULL);
         ENTRY;
 
         LASSERT(body != NULL);
@@ -1474,9 +1473,6 @@ int mds_getattr_size(struct obd_device *obd, struct dentry *dentry,
                 RETURN(0);
         }
 
                 RETURN(0);
         }
 
-        /*if (mds->mds_config_generation)
-                return 0;*/
-
         if (atomic_read(&inode->i_writecount)) {
                 /* some one has opened the file for write.
                  * mds doesn't know actual size */
         if (atomic_read(&inode->i_writecount)) {
                 /* some one has opened the file for write.
                  * mds doesn't know actual size */
index 543f539..25fad02 100644 (file)
@@ -179,7 +179,7 @@ int mds_dt_update_config(struct obd_device *obd, int transno);
 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
                        struct lov_mds_md *lmm, int lmm_size);
 int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
 int mds_convert_lov_ea(struct obd_device *obd, struct inode *inode,
                        struct lov_mds_md *lmm, int lmm_size);
 int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
-                          struct lustre_msg *msg, int offset, int *changed);
+                          struct lustre_msg *msg, int offset);
 void mds_dt_update_objids(struct obd_device *obd, obd_id *ids);
 void mds_dt_save_objids(struct obd_device *obd, obd_id *ids);
 
 void mds_dt_update_objids(struct obd_device *obd, obd_id *ids);
 void mds_dt_save_objids(struct obd_device *obd, obd_id *ids);
 
index 6586f6d..ddc5958 100644 (file)
@@ -851,7 +851,6 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
                 sprintf(name, "%s-%d", profile, version);
         }
         CWARN("Applying configuration log %s\n", name);
                 sprintf(name, "%s-%d", profile, version);
         }
         CWARN("Applying configuration log %s\n", name);
-        mds->mds_config_generation++;
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         ctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         ctxt = llog_get_context(&obd->obd_llogs, LLOG_CONFIG_ORIG_CTXT);
@@ -862,15 +861,13 @@ int mds_dt_update_config(struct obd_device *obd, int clean)
                 GOTO(exit, rc);
         }
         /* retrieve size of EA */
                 GOTO(exit, rc);
         }
         /* retrieve size of EA */
-        if (mds->mds_md_exp) {
-                rc = obd_get_info(mds->mds_md_exp, strlen("mdsize"),
-                                  "mdsize", &valsize, &value);
-
-                if (value > mds->mds_max_mdsize)
-                        mds->mds_max_mdsize = value;
+        rc = obd_get_info(mds->mds_md_exp, strlen("mdsize"),
+                          "mdsize", &valsize, &value);
+        
+        if (value > mds->mds_max_mdsize)
+                mds->mds_max_mdsize = value;
 
 
-                CDEBUG(D_INFO, "mds max md size %d \n", mds->mds_max_mdsize);
-        }
+        CDEBUG(D_INFO, "mds max md size %d \n", mds->mds_max_mdsize);
         
         if (rc == 0)
                 mds->mds_config_version = version;
         
         if (rc == 0)
                 mds->mds_config_version = version;
@@ -932,7 +929,7 @@ conv_end:
 
 /* Must be called with i_sem held */
 int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
 
 /* Must be called with i_sem held */
 int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
-                          struct lustre_msg *msg, int offset, int *changed)
+                          struct lustre_msg *msg, int offset)
 {
         struct mds_obd *mds = &obd->u.mds;
         struct obd_export *dt_exp = mds->mds_dt_exp;
 {
         struct mds_obd *mds = &obd->u.mds;
         struct obd_export *dt_exp = mds->mds_dt_exp;
@@ -948,7 +945,6 @@ int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
         void *handle;
         ENTRY;
 
         void *handle;
         ENTRY;
 
-        *changed = 0;
         LASSERT(down_trylock(&inode->i_sem) != 0);
 
         ll_id2str(idname, inode->i_ino, inode->i_generation);
         LASSERT(down_trylock(&inode->i_sem) != 0);
 
         ll_id2str(idname, inode->i_ino, inode->i_generation);
@@ -999,7 +995,6 @@ int mds_revalidate_lov_ea(struct obd_device *obd, struct dentry *dentry,
                 GOTO(out_oa, rc);
         }
 
                 GOTO(out_oa, rc);
         }
 
-        *changed = 1;
         rc = obd_packmd(dt_exp, &lmm, lsm);
         if (rc < 0)
                 GOTO(out_oa, rc);
         rc = obd_packmd(dt_exp, &lmm, lsm);
         if (rc < 0)
                 GOTO(out_oa, rc);
index c411f71..52aef76 100644 (file)
@@ -718,8 +718,7 @@ int accmode(int flags)
 /* Handles object creation, actual opening, and I/O epoch */
 static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild,
                            struct mds_body *body, int flags, void **handle,
 /* Handles object creation, actual opening, and I/O epoch */
 static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild,
                            struct mds_body *body, int flags, void **handle,
-                           struct mds_update_record *rec, struct ldlm_reply *rep,
-                           int *cancel_update_lock)
+                           struct mds_update_record *rec, struct ldlm_reply *rep)
 {
         struct obd_device *obd = req->rq_export->exp_obd;
         struct mds_obd *mds = mds_req2mds(req);
 {
         struct obd_device *obd = req->rq_export->exp_obd;
         struct mds_obd *mds = mds_req2mds(req);
@@ -730,8 +729,6 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild,
         int rc = 0, reply_off;
         ENTRY;
 
         int rc = 0, reply_off;
         ENTRY;
 
-        *cancel_update_lock = 0;
-
         /* atomically create objects if necessary */
         down(&dchild->d_inode->i_sem);
         mode = dchild->d_inode->i_mode;
         /* atomically create objects if necessary */
         down(&dchild->d_inode->i_sem);
         mode = dchild->d_inode->i_mode;
@@ -766,22 +763,10 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild,
                 
                 if (S_ISREG(dchild->d_inode->i_mode) &&
                     (body->valid & OBD_MD_FLEASIZE)) {
                 
                 if (S_ISREG(dchild->d_inode->i_mode) &&
                     (body->valid & OBD_MD_FLEASIZE)) {
-                        int changed;
-                        rc = mds_revalidate_lov_ea(obd, dchild,
-                                                   req->rq_repmsg, 2,
-                                                   &changed);
-                        if (!rc) {
+                        rc = mds_revalidate_lov_ea(obd,dchild,req->rq_repmsg,2);
+                        if (!rc)
                                 rc = mds_pack_md(obd, req->rq_repmsg, 2, body,
                                                  dchild->d_inode, 0, 0);
                                 rc = mds_pack_md(obd, req->rq_repmsg, 2, body,
                                                  dchild->d_inode, 0, 0);
-                                /* after ost add/delete, lov ea can change
-                                 * along with size/blocks, which we have
-                                 * to update as well */
-                                if (changed) {
-                                        body->size = dchild->d_inode->i_size;
-                                        body->blocks = dchild->d_inode->i_blocks;
-                                        *cancel_update_lock = 1;
-                                }
-                        }
                         if (rc) {
                                 up(&dchild->d_inode->i_sem);
                                 RETURN(rc);
                         if (rc) {
                                 up(&dchild->d_inode->i_sem);
                                 RETURN(rc);
@@ -861,7 +846,7 @@ static int mds_open_by_id(struct ptlrpc_request *req,
         struct inode *pending_dir = mds->mds_pending_dir->d_inode;
         struct dentry *dchild;
         char idname[LL_ID_NAMELEN];
         struct inode *pending_dir = mds->mds_pending_dir->d_inode;
         struct dentry *dchild;
         char idname[LL_ID_NAMELEN];
-        int idlen = 0, rc, fake;
+        int idlen = 0, rc;
         void *handle = NULL;
         ENTRY;
 
         void *handle = NULL;
         ENTRY;
 
@@ -904,7 +889,7 @@ static int mds_open_by_id(struct ptlrpc_request *req,
         intent_set_disposition(rep, DISP_LOOKUP_POS);
 
  open:
         intent_set_disposition(rep, DISP_LOOKUP_POS);
 
  open:
-        rc = mds_finish_open(req, dchild, body, flags, &handle, rec, rep,&fake);
+        rc = mds_finish_open(req, dchild, body, flags, &handle, rec, rep);
         rc = mds_finish_transno(mds, dchild ? dchild->d_inode : NULL, handle,
                                 req, rc, rep ? rep->lock_policy_res1 : 0);
         /* XXX what do we do here if mds_finish_transno itself failed? */
         rc = mds_finish_transno(mds, dchild ? dchild->d_inode : NULL, handle,
                                 req, rc, rep ? rep->lock_policy_res1 : 0);
         /* XXX what do we do here if mds_finish_transno itself failed? */
@@ -985,7 +970,6 @@ int mds_open(struct mds_update_record *rec, int offset,
         int child_mode = LCK_PR;
         struct lustre_id sid;
         __u64 fid = 0;
         int child_mode = LCK_PR;
         struct lustre_id sid;
         __u64 fid = 0;
-        int cancel_update_lock;
         ENTRY;
 
         DEBUG_REQ(D_INODE, req, "parent "DLID4" name %*s mode %o",
         ENTRY;
 
         DEBUG_REQ(D_INODE, req, "parent "DLID4" name %*s mode %o",
@@ -1414,7 +1398,7 @@ got_child:
 
         /* Step 5: mds_open it */
         rc = mds_finish_open(req, dchild, body, rec->ur_flags, &handle,
 
         /* Step 5: mds_open it */
         rc = mds_finish_open(req, dchild, body, rec->ur_flags, &handle,
-                             rec, rep, &cancel_update_lock);
+                             rec, rep);
         if (rc)
                 GOTO(cleanup, rc);
 
         if (rc)
                 GOTO(cleanup, rc);
 
@@ -1434,7 +1418,7 @@ got_child:
          * isize/iblocks from mds anymore.
          * FIXME: can cause a deadlock, use mds_get_parent_child_locked()
          * XXX: optimization is to do this for first writer only */
          * isize/iblocks from mds anymore.
          * FIXME: can cause a deadlock, use mds_get_parent_child_locked()
          * XXX: optimization is to do this for first writer only */
-        if ((accmode(rec->ur_flags) & MAY_WRITE) || cancel_update_lock) {
+        if (accmode(rec->ur_flags) & MAY_WRITE) {
                 struct ldlm_res_id child_res_id = { .name = {0}};
                 ldlm_policy_data_t sz_policy;
                 struct lustre_handle sz_lockh;
                 struct ldlm_res_id child_res_id = { .name = {0}};
                 ldlm_policy_data_t sz_policy;
                 struct lustre_handle sz_lockh;