diff options
| -rw-r--r-- | xlators/features/trash/src/trash.c | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 1381e8b049d..4b0e6741d9a 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -669,6 +669,17 @@ trash_unlink_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  }          } +        if ((op_ret == -1) && (op_errno != EEXIST)) { +                gf_log (this->name, GF_LOG_ERROR, "Directory creation failed [%s]. " +                                "Therefore unlinking %s without moving to trash " +                                "directory", strerror(op_errno), local->loc.name); +                STACK_WIND (frame, trash_common_unwind_cbk, +                            FIRST_CHILD(this), +                            FIRST_CHILD(this)->fops->unlink, &local->loc, 0, +                            xdata); +                goto out; +        } +          LOCK (&frame->lock);          {                  loop_count = ++local->loop_count; @@ -1456,6 +1467,18 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  }          } +        if ((op_ret == -1) && (op_errno != EEXIST)) { +                gf_log (this->name, GF_LOG_ERROR, "Directory creation failed [%s]. " +                                "Therefore truncating %s without moving the " +                                "original copy to trash directory", +                                strerror(op_errno), local->loc.name); +                STACK_WIND (frame, trash_common_unwind_buf_cbk, +                            FIRST_CHILD(this), +                            FIRST_CHILD(this)->fops->truncate, &local->loc, +                            local->fop_offset, xdata); +                goto out; +        } +          LOCK (&frame->lock);          {                  loop_count = ++local->loop_count;  | 
