diff options
author | Ravishankar N <ravishankar@redhat.com> | 2017-08-07 12:14:23 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendra@redhat.com> | 2017-08-08 12:54:25 +0000 |
commit | c63aa2239bc682739328e0aa6cbcb3279a72a8e2 (patch) | |
tree | 2288cd9703ca902e8ac418eefb5eff89dce46708 /xlators/features/trash | |
parent | cdca1cb26a0aba390c6d8485c0d6d95e22ffc8bd (diff) |
posix: add null gfid checks
...in file/dir creation and lookup codepaths. The check is relaxed for
fops coming from trash xlator at the moment until trash has client side
logic to send the create fops with gfid-req.
Also fixed the missing trash pid assignment in creates sent by trash
xlator. Without this, truncated files won't be moved to .trashcan.
Change-Id: Ieddd7f0634850e7c7010e4fbb4ad1eead35888c8
BUG: 1478297
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: https://review.gluster.org/17975
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/trash')
-rw-r--r-- | xlators/features/trash/src/trash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index ab01832bb8b..4a41a14f427 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1579,6 +1579,8 @@ trash_truncate_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; GF_VALIDATE_OR_GOTO ("trash", local, out); + TRASH_UNSET_PID (frame, local); + /* Checks whether path is present in trash directory or not */ if ((op_ret == -1) && (op_errno == ENOENT)) { @@ -1753,6 +1755,9 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strcat (real_path, local->origpath); /* Call create again once directory structure is created. */ + + TRASH_SET_PID (frame, local); + STACK_WIND (frame, trash_truncate_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, @@ -1957,6 +1962,8 @@ trash_truncate_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, flags = O_CREAT|O_EXCL|O_WRONLY; + TRASH_SET_PID (frame, local); + STACK_WIND (frame, trash_truncate_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, |