summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2015-03-24 16:29:13 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-30 00:48:50 -0700
commit3db5f3a41b7029ce8005d1e1cc01808a15cc6019 (patch)
treee5ec7abcd69fe300a4a77eef43987d89755686e6 /xlators/features/trash
parentb828932c1430bfc62d7c3c83fec8e4a79ca4dbe6 (diff)
features/trash : Discarding extended truncate for trash-translator
Change-Id: I5c571cbb2d6da1e95831ec206639926722a9d281 BUG: 1132465 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/9984 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anoop C S <achiraya@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/trash')
-rw-r--r--xlators/features/trash/src/trash.c12
1 files changed, 8 insertions, 4 deletions
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),