Whamcloud - gitweb
b=7214
authortappro <tappro>
Tue, 23 Aug 2005 08:40:34 +0000 (08:40 +0000)
committertappro <tappro>
Tue, 23 Aug 2005 08:40:34 +0000 (08:40 +0000)
- fix duplicate name in open/stat auditing. Name is needed only if lustre id cannot be saved.

lustre/mds/handler.c
lustre/mds/mds_audit.c
lustre/mds/mds_open.c

index bea8ec7..26fccc6 100644 (file)
@@ -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:
index ddff7f4..a8bd018 100644 (file)
@@ -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);
index e854a45..a3ab2bb 100644 (file)
@@ -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);