Whamcloud - gitweb
use inode->i_mode instead of fid type, and comment out the assertions, because
authorniu <niu>
Fri, 19 Aug 2005 09:36:15 +0000 (09:36 +0000)
committerniu <niu>
Fri, 19 Aug 2005 09:36:15 +0000 (09:36 +0000)
type in lustre id are not always correct.(client don't update type in lli_id;
id for cross-ref inode never store mode)

lustre/mds/mds_audit_path.c
lustre/smfs/audit_mds.c
lustre/smfs/audit_transfer.c

index 59d371f..c1ffd4b 100644 (file)
@@ -141,8 +141,8 @@ id2pid(struct obd_device *obd, struct lustre_id *id, struct lustre_id *pid,
         }
         inode = dentry->d_inode;
 
-        if (S_ISDIR(id_type(id))) {
-                LASSERT(S_ISDIR(inode->i_mode));
+        if (S_ISDIR(inode->i_mode)) {
+                //LASSERT(S_ISDIR(id_type(id)));
                 rc = mds_md_get_attr(obd, inode, &mea, &mea_size);
                 if (rc)
                         GOTO(out, rc);
@@ -159,7 +159,7 @@ id2pid(struct obd_device *obd, struct lustre_id *id, struct lustre_id *pid,
                 }
                                 
         } else {
-                LASSERT(!S_ISDIR(inode->i_mode));
+                //LASSERT(!S_ISDIR(id_type(id)));
                 *type = PP_FILE;
 read_pid:
                 rc = mds_read_inode_pid(obd, inode, pid);
@@ -197,9 +197,10 @@ static int local_parse_id(struct obd_device *obd, struct parseid_pkg *pkg)
         /* pp_id2 is present, which indicating we want to scan parent 
          * dir(pp_id2) to find the cross-ref entry(pp_id1) */
         if (id_fid(&pkg->pp_id2)) {
+                /* 
                 LASSERT(S_ISDIR(id_type(&pkg->pp_id1)));
                 LASSERT(S_ISDIR(id_type(&pkg->pp_id2)));
-
+                */
                 pkg->pp_type = PP_DIR;
                 goto scan;
         }
index 20a14ae..dd0cf37 100644 (file)
@@ -234,7 +234,7 @@ int audit_mds_special_rec(struct inode * inode, void * arg,
         /* check id is valid */
         LASSERT(id_ino(&msg->id));
         LASSERT(id_fid(&msg->id));
-        LASSERT(id_type(&msg->id) & S_IFMT);
+        // LASSERT(id_type(&msg->id) & S_IFMT);
         
         len += audit_rec_from_id(&pbuf, &msg->id);
         switch (rec->opcode)
index d5cca9a..3e36b4f 100644 (file)
@@ -163,6 +163,7 @@ transfer_record(struct obd_device *obd, struct audit_record *rec, int type, void
         
                 REC2ID(id_rec, &id);
                 
+                //LASSERT(id_type(&id) & S_IFMT);
                 rc = audit_id2name(obd, &name, &namelen, &id);
                 if (rc < 0) {
                         strncat(buf, "unknown", PAGE_SIZE - n);