summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2018-03-16 10:15:52 +0530
committerAmar Tumballi <amarts@redhat.com>2018-04-10 02:39:55 +0000
commit25b8139c74ae3127905a86dd5f834c39746ad8d7 (patch)
tree1e400b8ccf17c181b91590e34c22a86043a058dc /xlators/storage/posix/src/posix.c
parent13c8bf60155b5ab09d60d4a04f2b0d38014e5fca (diff)
posix: check file state before continuing with fops
In context of Cloudsync: In scenarios where a data modification fop e.g. a write landed in POSIX thinking that the file is local, while the file was actually remote, can be dangerous. Ofcourse we don’t want to take inodelk for every read/write operation to check the archival status or coordinate with an upload or a download of a file. To avoid inodelk, we will check the status of the file in POSIX it self, before we resume the fop. This helps us avoiding any races mentioned above. Now e.g. if a write reached POSIX for a file which was actually remote, it can check the status of the file and will get to know that the file is remote. It can error out with this status “remote” and cloudsync xlator will retry the same operation, once it finished downloading the file. This patch includes the setxattr changes to do the post processing of upload i.e. truncate and setting the remote xattr "trusted.glusterfs.cs.remote" to indicate the file is REMOTE Each file will have no xattr if the file is LOCAL, one remote xattr if the file is REMOTE and a combination of REMOTE and DOWNLOADING xattr if the file is getting downloaded. There is healing logic of these xattrs to recover from crash inconsitencies. Fixes: #387 Change-Id: Ie93c2d41aa8d6a798a39bdbef9d1669f057e5fdb Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 9ac60ae81d3..c3e48d55ae6 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -71,8 +71,8 @@ struct xlator_fops fops = {
.fxattrop = posix_fxattrop,
.setattr = posix_setattr,
.fsetattr = posix_fsetattr,
- .fallocate = posix_glfallocate,
- .discard = posix_discard,
+ .fallocate = posix_glfallocate,
+ .discard = posix_discard,
.zerofill = posix_zerofill,
.ipc = posix_ipc,
#ifdef HAVE_SEEK_HOLE