From 5cb948be3e0691428ac3a9bc6f75a8c2b23a9611 Mon Sep 17 00:00:00 2001 From: niu Date: Fri, 19 Aug 2005 09:36:15 +0000 Subject: [PATCH] use inode->i_mode instead of fid type, and comment out the assertions, because 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 | 9 +++++---- lustre/smfs/audit_mds.c | 2 +- lustre/smfs/audit_transfer.c | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lustre/mds/mds_audit_path.c b/lustre/mds/mds_audit_path.c index 59d371f..c1ffd4b 100644 --- a/lustre/mds/mds_audit_path.c +++ b/lustre/mds/mds_audit_path.c @@ -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; } diff --git a/lustre/smfs/audit_mds.c b/lustre/smfs/audit_mds.c index 20a14ae..dd0cf37 100644 --- a/lustre/smfs/audit_mds.c +++ b/lustre/smfs/audit_mds.c @@ -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) diff --git a/lustre/smfs/audit_transfer.c b/lustre/smfs/audit_transfer.c index d5cca9a..3e36b4f 100644 --- a/lustre/smfs/audit_transfer.c +++ b/lustre/smfs/audit_transfer.c @@ -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); -- 1.8.3.1