Whamcloud - gitweb
b=8654
authortappro <tappro>
Tue, 13 Sep 2005 11:07:14 +0000 (11:07 +0000)
committertappro <tappro>
Tue, 13 Sep 2005 11:07:14 +0000 (11:07 +0000)
- fix for client STAT logging

lustre/llite/file.c
lustre/llite/namei.c

index 2f133e5..03a7c05 100644 (file)
@@ -1271,7 +1271,7 @@ static ssize_t ll_file_write(struct file *file, const char *buf,
 
         EXIT;
 out:
-        ll_audit_log(inode, AUDIT_WRITE, retval);
+        /* ll_audit_log(inode, AUDIT_WRITE, retval); */
 
         ll_tree_unlock(&tree, inode);
         /* serialize with mmap/munmap/mremap */
@@ -1852,13 +1852,16 @@ int ll_inode_revalidate_it(struct dentry *dentry)
                             &oit, 0, &req, ll_mdc_blocking_ast);
         if (rc < 0)
                 GOTO(out, rc);
-
+        
         rc = revalidate_it_finish(req, 1, &oit, dentry);
         if (rc) {
                 GOTO(out, rc);
         }
 
         ll_lookup_finish_locks(&oit, dentry);
+        
+        if (!req && (it->it_op & IT_GETATTR))
+                ll_audit_log(inode, AUDIT_STAT, 0);
 
         if (!LLI_HAVE_FLSIZE(inode)) {
                 /* if object not yet allocated, don't validate size */
@@ -1874,6 +1877,7 @@ out:
         ll_intent_release(&oit);
         if (req)
                 ptlrpc_req_finished(req);
+        
         return rc;
 }
 
index c207128..1ade3da 100644 (file)
@@ -401,7 +401,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
                             ll_mdc_blocking_ast);
         if (rc < 0)
                 GOTO(out, retval = ERR_PTR(rc));
-
+        
         rc = lookup_it_finish(req, 1, it, &icbd);
         if (rc != 0) {
                 ll_intent_release(it);
@@ -410,6 +410,9 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry,
 
         ll_lookup_finish_locks(it, dentry);
 
+        if (!req && (it->it_op & IT_GETATTR) && dentry->d_inode)
+                ll_audit_log(dentry->d_inode, AUDIT_STAT, 0);
+
         if (nd && dentry->d_inode != NULL &&
             dentry->d_inode->i_mode & S_ISUID && S_ISDIR(dentry->d_inode->i_mode) &&
             ((gns_flags & LOOKUP_CONTINUE) || (gns_it & (IT_CHDIR | IT_OPEN))))