summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-10-29 05:08:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-29 10:17:19 -0700
commitd72c47cb04725c694921e7f3277f6230c26bc936 (patch)
tree2ecc6752d4caed385f629b96d2eb636fbe113401 /xlators/cluster/afr/src/afr.c
parent14962ce3e69e452a2447c12cde3369759365fda9 (diff)
cluster/afr: Move deleted files to /.trash in entry self-heal.
If entry self-heal determines that a file/directory should be deleted from a subvolume, move that entry to a directory called "/.trash" on that subvolume. This is for two reasons: 1) It limits the damage that can be done by a "wrong" entry self-heal. 2) It solves the problem of a to-be-deleted directory not being empty. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 227 (replicate selfheal does not remove directory with contents in it) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=227
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index c9a46f28a..c60e1b33c 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -662,6 +662,11 @@ afr_lookup (call_frame_t *frame, xlator_t *this,
frame->local = local;
+ if (!strcmp (loc->path, "/" AFR_TRASH_DIR)) {
+ op_errno = ENOENT;
+ goto out;
+ }
+
loc_copy (&local->loc, loc);
ret = inode_ctx_get (loc->inode, this, &ctx);