From: Jeff Layton <jlayton@redhat.com>
To: eparis@redhat.com, viro@zeniv.linux.org.uk
Cc: linux-audit@redhat.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 1/9] audit: remove unnecessary NULL ptr checks from do_path_lookup
Date: Tue, 26 Jun 2012 12:35:29 -0400 [thread overview]
Message-ID: <1340728537-25599-2-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1340728537-25599-1-git-send-email-jlayton@redhat.com>
As best I can tell, whenever retval == 0, nd->path.dentry and nd->inode
are also non-NULL. Eliminate those checks and the superfluous
audit_context check.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
fs/namei.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 7d69419..5f6a34d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1812,12 +1812,8 @@ static int do_path_lookup(int dfd, const char *name,
if (unlikely(retval == -ESTALE))
retval = path_lookupat(dfd, name, flags | LOOKUP_REVAL, nd);
- if (likely(!retval)) {
- if (unlikely(!audit_dummy_context())) {
- if (nd->path.dentry && nd->inode)
- audit_inode(name, nd->path.dentry);
- }
- }
+ if (likely(!retval))
+ audit_inode(name, nd->path.dentry);
return retval;
}
--
1.7.7.6
next prev parent reply other threads:[~2012-06-26 16:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 16:35 [PATCH v4 0/9] audit: overhaul audit_names handling to allow for retrying on path-based syscalls Jeff Layton
2012-06-26 16:35 ` Jeff Layton [this message]
2012-06-26 16:35 ` [PATCH v4 2/9] audit: pass in dentry to audit_copy_inode wherever possible Jeff Layton
2012-06-26 16:35 ` [PATCH v4 3/9] audit: reverse arguments to audit_inode_child Jeff Layton
2012-06-26 16:35 ` [PATCH v4 4/9] audit: add a new "type" field to audit_names struct Jeff Layton
2012-06-26 16:35 ` [PATCH v4 5/9] audit: set the name_len in audit_inode for parent lookups Jeff Layton
2012-06-26 16:35 ` [PATCH v4 6/9] audit: remove dirlen argument to audit_compare_dname_path Jeff Layton
2012-06-26 16:35 ` [PATCH v4 7/9] audit: make audit_compare_dname_path use parent_len helper Jeff Layton
2012-06-26 16:35 ` [PATCH v4 8/9] audit: optimize audit_compare_dname_path Jeff Layton
2012-06-26 16:35 ` [PATCH v4 9/9] audit: overhaul __audit_inode_child to accomodate retrying Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340728537-25599-2-git-send-email-jlayton@redhat.com \
--to=jlayton@redhat.com \
--cc=eparis@redhat.com \
--cc=linux-audit@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).