summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/storage/posix/src/posix.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 5cfdbd4f5ee..b5957e4e9c6 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1281,9 +1281,9 @@ posix_rename (call_frame_t *frame, xlator_t *this,
struct iatt postnewparent = {0, };
char olddirid[64];
char newdirid[64];
- uuid_t victim;
- int was_dir;
- int nlink;
+ uuid_t victim = {0};
+ int was_dir = 0;
+ int nlink = 0;
DECLARE_OLD_FS_ID_VAR;
@@ -1365,7 +1365,7 @@ posix_rename (call_frame_t *frame, xlator_t *this,
if (was_dir)
posix_handle_unset (this, victim, NULL);
- if (was_present && !was_dir && nlink == 2)
+ if (was_present && !was_dir && nlink == 1)
posix_handle_unset (this, victim, NULL);
if (IA_ISDIR (oldloc->inode->ia_type)) {