All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix nfsidem cthon test
@ 2004-10-21  6:51 Greg Banks
  2004-10-21  7:31 ` Trond Myklebust
  0 siblings, 1 reply; 19+ messages in thread
From: Greg Banks @ 2004-10-21  6:51 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Linux NFS Mailing List

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

G'day,

The attached patch forward ports from 2.4 the fix to nfs_rename()
which makes the nfsidem test in the Connectathon test suite pass.

Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.


[-- Attachment #2: gnb-nfs-rename --]
[-- Type: text/plain, Size: 1015 bytes --]

Fix nfs_rename() so the nfsidem test in the Connectathon test suite passes.


Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>


Index: linux/fs/nfs/dir.c
===================================================================
--- linux.orig/fs/nfs/dir.c	2004-10-04 14:35:26.%N +1000
+++ linux/fs/nfs/dir.c	2004-10-21 15:45:21.%N +1000
@@ -1409,7 +1409,7 @@ static int nfs_rename(struct inode *old_
 	struct inode *old_inode = old_dentry->d_inode;
 	struct inode *new_inode = new_dentry->d_inode;
 	struct dentry *dentry = NULL, *rehash = NULL;
-	int error = -EBUSY;
+	int error;
 
 	/*
 	 * To prevent any new references to the target during the rename,
@@ -1436,6 +1436,12 @@ static int nfs_rename(struct inode *old_
 	 */
 	if (!new_inode)
 		goto go_ahead;
+	/* If target is a hard link to the source, then noop */
+	error = 0;
+	if (NFS_FILEID(new_inode) == NFS_FILEID(old_inode))
+		goto out;
+
+	error = -EBUSY;
 	if (S_ISDIR(new_inode->i_mode))
 		goto out;
 	else if (atomic_read(&new_dentry->d_count) > 1) {

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

end of thread, other threads:[~2004-10-27 16:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-21  6:51 [PATCH] fix nfsidem cthon test Greg Banks
2004-10-21  7:31 ` Trond Myklebust
2004-10-21  7:51   ` Greg Banks
2004-10-21  7:40     ` Trond Myklebust
2004-10-21 16:13   ` J. Bruce Fields
2004-10-22  2:56     ` Greg Banks
2004-10-22  2:43       ` J. Bruce Fields
2004-10-25  9:33         ` Greg Banks
2004-10-25 14:41           ` Trond Myklebust
2004-10-26  7:32             ` Greg Banks
2004-10-26 16:55               ` Trond Myklebust
2004-10-27  0:40                 ` Greg Banks
2004-10-27 16:53                   ` Trond Myklebust
2004-10-22  3:18       ` Neil Brown
2004-10-22  4:12         ` Greg Banks
2004-10-22 12:28           ` Greg Banks
2004-10-22 17:06             ` Trond Myklebust
2004-10-22 21:35         ` Trond Myklebust
2004-10-22 16:38     ` Trond Myklebust

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.