Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1e4adf4 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFS: Fix the notifications when renaming onto an existing file

NFS appears to be returning an unnecessary "delete" notification when
we're doing an atomic rename. See

  http://bugzilla.gnome.org/show_bug.cgi?id=575684



The fix is to get rid of the redundant call to d_delete().

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 47c62564
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -1624,8 +1624,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
		} else if (atomic_read(&new_dentry->d_count) > 1)
		} else if (atomic_read(&new_dentry->d_count) > 1)
			/* dentry still busy? */
			/* dentry still busy? */
			goto out;
			goto out;
	} else
	}
		nfs_drop_nlink(new_inode);


go_ahead:
go_ahead:
	/*
	/*
@@ -1638,10 +1637,8 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
	}
	}
	nfs_inode_return_delegation(old_inode);
	nfs_inode_return_delegation(old_inode);


	if (new_inode != NULL) {
	if (new_inode != NULL)
		nfs_inode_return_delegation(new_inode);
		nfs_inode_return_delegation(new_inode);
		d_delete(new_dentry);
	}


	error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name,
	error = NFS_PROTO(old_dir)->rename(old_dir, &old_dentry->d_name,
					   new_dir, &new_dentry->d_name);
					   new_dir, &new_dentry->d_name);
@@ -1650,6 +1647,8 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
	if (rehash)
	if (rehash)
		d_rehash(rehash);
		d_rehash(rehash);
	if (!error) {
	if (!error) {
		if (new_inode != NULL)
			nfs_drop_nlink(new_inode);
		d_move(old_dentry, new_dentry);
		d_move(old_dentry, new_dentry);
		nfs_set_verifier(new_dentry,
		nfs_set_verifier(new_dentry,
					nfs_save_change_attribute(new_dir));
					nfs_save_change_attribute(new_dir));