summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorAshish Pandey <aspandey@redhat.com>2015-11-26 14:35:49 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-01-25 03:37:10 -0800
commit195548f55b09bf71db92929b7b734407b863093c (patch)
tree08b113e723811733528e46fb454fb1e397e69820 /libglusterfs
parentfa6545a323df920768dd25989537e6a350c10432 (diff)
storage/posix: Implement .unlink directory
Problem: For EC volume, If a file descriptor is open and file has been unlinked, any further write on that fd will fail. When a write request comes, EC internally reads some blocks using anonymous fd. This read will fail as the file has already been unlinked. Solution: To solve this issue, we are using .unlink directory to keep track of unlinked file. If a file is to be unlinked while its fd is open, move this to .unlink directory and unlink it from .glusterfs and real path. Once all the fd will be closed, remove this entry form .unlink directory. master - http://review.gluster.org/#/c/12816/ Change-Id: I8344edb0d340bdb883dc46458c16edbc336916b9 BUG: 1291557 Signed-off-by: Ashish Pandey <aspandey@redhat.com> Reviewed-on: http://review.gluster.org/12968 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.h2
-rw-r--r--libglusterfs/src/inode.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 0a71577a5c7..8093f33d5de 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -343,6 +343,8 @@ union gf_sock_union {
};
#define GF_HIDDEN_PATH ".glusterfs"
+#define GF_UNLINK_PATH GF_HIDDEN_PATH"/unlink"
+#define GF_LANDFILL_PATH GF_HIDDEN_PATH"/landfill"
#define IOV_MIN(n) min(IOV_MAX,n)
diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h
index a17970e8174..96025b9ec43 100644
--- a/libglusterfs/src/inode.h
+++ b/libglusterfs/src/inode.h
@@ -98,7 +98,7 @@ struct _inode {
struct list_head hash; /* hash table pointers */
struct list_head list; /* active/lru/purge */
- struct _inode_ctx *_ctx; /* replacement for dict_t *(inode->ctx) */
+ struct _inode_ctx *_ctx; /* replacement for dict_t *(inode->ctx) */
};