diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 2f133e5d60074abd5b285baac884e387994f43cf..03a7c05c1368b688435d112751e57811c30e07a3 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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; } diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index c207128f356761f3e5cf44a5b8f3560e63cea333..1ade3da80c5d63e39ec5bfd30bedbd1e0793780e 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -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))))