From 3db5f3a41b7029ce8005d1e1cc01808a15cc6019 Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Tue, 24 Mar 2015 16:29:13 +0530 Subject: features/trash : Discarding extended truncate for trash-translator Change-Id: I5c571cbb2d6da1e95831ec206639926722a9d281 BUG: 1132465 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/9984 Tested-by: Gluster Build System Reviewed-by: Anoop C S Reviewed-by: Vijay Bellur --- xlators/features/trash/src/trash.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 80be9b110cb..d0e48506d4a 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1476,10 +1476,14 @@ trash_truncate_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - /* If the file is too big, just unlink it. */ - if (buf->ia_size > (priv->max_trash_file_size)) { - gf_log (this->name, GF_LOG_DEBUG, "%s: file too big, " - "not moving to trash", local->loc.path); + /** + * If the file is too big or if it is extended truncate, + * just don't move it to trash directory. + */ + if (buf->ia_size > (priv->max_trash_file_size) || + buf->ia_size <= local->fop_offset) { + gf_log (this->name, GF_LOG_DEBUG, "%s: not moving to trash , " + "having inappropiate file size", local->loc.path); STACK_WIND (frame, trash_common_unwind_buf_cbk, FIRST_CHILD(this), -- cgit