From: "J. Bruce Fields" <bfields@redhat.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
jlayton@redhat.com, Dave Chinner <david@fromorbit.com>,
"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 07/13] namei: minor vfs_unlink cleanup
Date: Wed, 11 Sep 2013 16:03:13 -0400 [thread overview]
Message-ID: <1378929799-1110-8-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1378929799-1110-1-git-send-email-bfields@redhat.com>
From: "J. Bruce Fields" <bfields@redhat.com>
We'll be using dentry->d_inode in one more place.
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
fs/namei.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/namei.c b/fs/namei.c
index 1e85a89..a23102c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3645,6 +3645,7 @@ SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
int vfs_unlink(struct inode *dir, struct dentry *dentry)
{
+ struct inode *target = dentry->d_inode;
int error = may_delete(dir, dentry, 0);
if (error)
@@ -3653,7 +3654,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
if (!dir->i_op->unlink)
return -EPERM;
- mutex_lock(&dentry->d_inode->i_mutex);
+ mutex_lock(&target->i_mutex);
if (d_mountpoint(dentry))
error = -EBUSY;
else {
@@ -3664,11 +3665,11 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
dont_mount(dentry);
}
}
- mutex_unlock(&dentry->d_inode->i_mutex);
+ mutex_unlock(&target->i_mutex);
/* We don't d_delete() NFS sillyrenamed files--they still exist. */
if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
- fsnotify_link_count(dentry->d_inode);
+ fsnotify_link_count(target);
d_delete(dentry);
}
--
1.7.9.5
next prev parent reply other threads:[~2013-09-11 20:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 20:03 [PATCH 00/13] Implement NFSv4 delegations, take 11 J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
2013-09-11 20:03 ` [PATCH 01/13] vfs: pull ext4's double-i_mutex-locking into common code J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
2013-09-11 20:03 ` [PATCH 02/13] vfs: don't use PARENT/CHILD lock classes for non-directories J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
2013-09-12 3:14 ` J. Bruce Fields
2013-09-12 3:14 ` J. Bruce Fields
2013-09-12 3:16 ` [PATCH 02/13--revised] " J. Bruce Fields
2013-09-12 3:16 ` J. Bruce Fields
2013-09-11 20:03 ` [PATCH 03/13] vfs: rename I_MUTEX_QUOTA now that it's not used for quotas J. Bruce Fields
2013-09-11 20:03 ` [PATCH 04/13] vfs: take i_mutex on renamed file J. Bruce Fields
2013-09-11 20:03 ` [PATCH 05/13] locks: introduce new FL_DELEG lock flag J. Bruce Fields
2013-09-11 20:03 ` [PATCH 06/13] locks: implement delegations J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields [this message]
2013-09-11 20:03 ` [PATCH 08/13] locks: break delegations on unlink J. Bruce Fields
2013-09-11 20:03 ` [PATCH 09/13] locks: helper functions for delegation breaking J. Bruce Fields
2013-09-11 20:03 ` [PATCH 10/13] locks: break delegations on rename J. Bruce Fields
2013-09-11 20:03 ` [PATCH 11/13] locks: break delegations on link J. Bruce Fields
2013-09-11 20:03 ` [PATCH 12/13] locks: break delegations on any attribute modification J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
2013-09-11 20:03 ` [PATCH 13/13] locks: close potential race between setlease and open J. Bruce Fields
2013-09-11 20:03 ` J. Bruce Fields
-- strict thread matches above, loose matches on Subject: below --
2013-09-19 20:50 [PATCH 00/13] Implement NFSv4 delegations, take 12 J. Bruce Fields
2013-09-19 20:50 ` [PATCH 07/13] namei: minor vfs_unlink cleanup J. Bruce Fields
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=1378929799-1110-8-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=david@fromorbit.com \
--cc=jlayton@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.