From 145bfe10f03edfc0e685097172b10b47d4ab4656 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Fri, 17 Apr 2009 11:45:30 -0400 Subject: [PATCH] --- yaml --- r: 143703 b: refs/heads/master c: fc6f394332ef1bf6ff5fbeaba0f2cd7a3c7971b6 h: refs/heads/master i: 143701: e6b01fe2e270a98669ac3e642df030378a412b3b 143699: c50ece9492adcb0f7239cf785b6bc0ee35bad508 143695: 6c3d97a50e862d4e301e025d00df2f5976f871b6 v: v3 --- [refs] | 2 +- trunk/fs/cifs/inode.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 8ce8eb6fcedc..f8bd5cbe5b27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 22c9d52bc03b880045ab1081890a38f11b272ae7 +refs/heads/master: fc6f394332ef1bf6ff5fbeaba0f2cd7a3c7971b6 diff --git a/trunk/fs/cifs/inode.c b/trunk/fs/cifs/inode.c index 09082ac85185..f36b4e40e443 100644 --- a/trunk/fs/cifs/inode.c +++ b/trunk/fs/cifs/inode.c @@ -1453,7 +1453,8 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry, checking the UniqueId via FILE_INTERNAL_INFO */ unlink_target: - if ((rc == -EACCES) || (rc == -EEXIST)) { + /* Try unlinking the target dentry if it's not negative */ + if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) { tmprc = cifs_unlink(target_dir, target_dentry); if (tmprc) goto cifs_rename_exit;