summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/trash/src/trash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index c2d36bd37d7..8549c644bf3 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -1073,7 +1073,6 @@ trash_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags,
loc_copy (&local->loc, loc);
/* rename new location of file as starting from trash directory */
- strcpy (local->origpath, pathbuf);
copy_trash_path (priv->newtrash_dir, (frame->root->pid < 0),
local->newpath);
strcat (local->newpath, pathbuf);
@@ -1725,6 +1724,8 @@ trash_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc,
goto out;
}
+ strcpy (local->origpath, pathbuf);
+
loc_copy (&local->loc, loc);
local->loc.path = pathbuf;
local->fop_offset = offset;
@@ -1819,6 +1820,8 @@ trash_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
goto out;
}
+ strcpy (local->origpath, pathbuf);
+
/* To convert fd to location */
frame->local=local;