From 3ae92197b35011c214f5536cddab11a97bb6d485 Mon Sep 17 00:00:00 2001 From: tappro Date: Tue, 23 Aug 2005 08:40:34 +0000 Subject: [PATCH] b=7214 - fix duplicate name in open/stat auditing. Name is needed only if lustre id cannot be saved. --- lustre/mds/handler.c | 11 +++++++---- lustre/mds/mds_audit.c | 1 + lustre/mds/mds_open.c | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index bea8ec7..26fccc6 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1695,12 +1695,15 @@ static int mds_getattr_lock(struct ptlrpc_request *req, int offset, if (resent_req == 0 && (dparent || dchild)) { struct inode * au_inode = NULL; - if (dchild && dchild->d_inode) + if (dchild && dchild->d_inode) { au_inode = dchild->d_inode; - else + mds_audit_stat(req, &body->id1, au_inode, + NULL, 0, rc); + } else { au_inode = dparent->d_inode; - - mds_audit_stat(req, &body->id1, au_inode, name, namesize, rc); + mds_audit_stat(req, &body->id1, au_inode, + name, namesize, rc); + } } switch (cleanup_phase) { case 2: diff --git a/lustre/mds/mds_audit.c b/lustre/mds/mds_audit.c index ddff7f4..a8bd018 100644 --- a/lustre/mds/mds_audit.c +++ b/lustre/mds/mds_audit.c @@ -166,6 +166,7 @@ static int mds_set_obj_audit(struct obd_device * obd, struct inode * inode, }; int len, rc = 0; void *lmm = NULL; + ENTRY; down(&inode->i_sem); len = fsfilt_get_md(obd, inode, NULL, 0, EA_LOV); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index e854a45..a3ab2bb 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -1462,14 +1462,17 @@ cleanup_no_trans: if (au_inode == NULL) { au_inode = dparent->d_inode; au_id = *(rec->ur_id1); + mds_audit_open(req, &au_id, au_inode, + rec->ur_name, rec->ur_namelen, + rc); } else { if (fid == 0) mds_read_inode_sid(obd, au_inode, &au_id); else mds_inode2id(obd, &au_id, au_inode, fid); + mds_audit_open(req, &au_id, au_inode, + NULL, 0, rc); } - mds_audit_open(req, &au_id, au_inode, - rec->ur_name, rec->ur_namelen, rc); } l_dput(dchild); -- 1.8.3.1