public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fs/inode.c: fix legacy comment about inode lock
@ 2012-08-24 11:51 yan
  2012-08-24 11:51 ` [PATCH 2/2] fs/namei.c: only check mountpoint on non-negative dentry yan
  0 siblings, 1 reply; 2+ messages in thread
From: yan @ 2012-08-24 11:51 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel

inode_lock has been changed to inode_hash_lock

Signed-off-by: yan <clouds.yan@gmail.com>
---
 fs/inode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/inode.c b/fs/inode.c
index ac8d904..a9be0a3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -778,7 +778,7 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
 
 static void __wait_on_freeing_inode(struct inode *inode);
 /*
- * Called with the inode lock held.
+ * Called with the inode_hash_lock held.
  */
 static struct inode *find_inode(struct super_block *sb,
 				struct hlist_head *head,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] fs/namei.c: only check mountpoint on non-negative dentry
  2012-08-24 11:51 [PATCH 1/2] fs/inode.c: fix legacy comment about inode lock yan
@ 2012-08-24 11:51 ` yan
  0 siblings, 0 replies; 2+ messages in thread
From: yan @ 2012-08-24 11:51 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel


Signed-off-by: yan <clouds.yan@gmail.com>
---
 fs/namei.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index dd1ed1b..028f5c8 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3628,11 +3628,15 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
 		return error;
 
 	dget(new_dentry);
-	if (target)
-		mutex_lock(&target->i_mutex);
 
 	error = -EBUSY;
-	if (d_mountpoint(old_dentry) || d_mountpoint(new_dentry))
+	if (target){
+		mutex_lock(&target->i_mutex);
+		if (d_mountpoint(new_dentry))
+			goto out;
+	}
+
+	if (d_mountpoint(old_dentry))
 		goto out;
 
 	error = -EMLINK;
@@ -3671,11 +3675,15 @@ static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
 		return error;
 
 	dget(new_dentry);
-	if (target)
-		mutex_lock(&target->i_mutex);
 
 	error = -EBUSY;
-	if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry))
+	if (target){
+		mutex_lock(&target->i_mutex);
+		if (d_mountpoint(new_dentry))
+			goto out;
+	}
+
+	if (d_mountpoint(old_dentry))
 		goto out;
 
 	error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-24 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 11:51 [PATCH 1/2] fs/inode.c: fix legacy comment about inode lock yan
2012-08-24 11:51 ` [PATCH 2/2] fs/namei.c: only check mountpoint on non-negative dentry yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox