From 285987ab9ed968a37df1bada56f137579146a23f Mon Sep 17 00:00:00 2001 From: Jiffin Tony Thottan Date: Fri, 21 Oct 2016 00:08:26 +0530 Subject: xlators/trash : Remove upper limit for trash max file size Currently file which size exceeds more than 1GB never moved to trash directory. This is due to the hard coded check using GF_ALLOWED_MAX_FILE_SIZE. Upstream reference : >Change-Id: I2ed707bfe1c3114818896bb27a9856b9a164be92 >BUG: 1386766 >Signed-off-by: Jiffin Tony Thottan >Reviewed-on: http://review.gluster.org/15689 >Smoke: Gluster Build System >Reviewed-by: Anoop C S >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Vijay Bellur >(cherry picked from commit cd9be49f6fe05d424989c0686a7e55a3f3ead27e) Change-Id: I2ed707bfe1c3114818896bb27a9856b9a164be92 BUG: 1392366 Signed-off-by: Jiffin Tony Thottan Reviewed-on: http://review.gluster.org/15786 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Anoop C S Reviewed-by: Niels de Vos --- xlators/features/trash/src/trash.c | 16 ++-------------- xlators/features/trash/src/trash.h | 4 ---- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 3a65d788ae9..4a400830642 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -2108,13 +2108,7 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("trash-max-filesize", max_fsize, options, size_uint64, out); if (max_fsize) { - if (max_fsize > GF_ALLOWED_MAX_FILE_SIZE) { - gf_log (this->name, GF_LOG_DEBUG, - "Size specified for max-size(in MB) is too " - "large so using 1GB as max-size (NOT IDEAL)"); - priv->max_trash_file_size = GF_ALLOWED_MAX_FILE_SIZE; - } else - priv->max_trash_file_size = max_fsize; + priv->max_trash_file_size = max_fsize; gf_log (this->name, GF_LOG_DEBUG, "%"GF_PRI_SIZET" max-size", priv->max_trash_file_size); } @@ -2437,13 +2431,7 @@ init (xlator_t *this) GF_DEFAULT_MAX_FILE_SIZE / GF_UNIT_MB); priv->max_trash_file_size = GF_DEFAULT_MAX_FILE_SIZE; } else { - if( max_trash_file_size64 > GF_ALLOWED_MAX_FILE_SIZE ) { - gf_log (this->name, GF_LOG_DEBUG, - "Size specified for max-size(in MB) is too " - "large so using 1GB as max-size (NOT IDEAL)"); - priv->max_trash_file_size = GF_ALLOWED_MAX_FILE_SIZE; - } else - priv->max_trash_file_size = max_trash_file_size64; + priv->max_trash_file_size = max_trash_file_size64; gf_log (this->name, GF_LOG_DEBUG, "%"GF_PRI_SIZET" max-size", priv->max_trash_file_size); } diff --git a/xlators/features/trash/src/trash.h b/xlators/features/trash/src/trash.h index cac7e5f02c4..b34f52f841e 100644 --- a/xlators/features/trash/src/trash.h +++ b/xlators/features/trash/src/trash.h @@ -33,10 +33,6 @@ #define GF_DEFAULT_MAX_FILE_SIZE (200 * GF_UNIT_MB) #endif -#ifndef GF_ALLOWED_MAX_FILE_SIZE -#define GF_ALLOWED_MAX_FILE_SIZE (1 * GF_UNIT_GB) -#endif - struct trash_struct { fd_t *fd; /* for the fd of existing file */ fd_t *newfd; /* for the newly created file */ -- cgit