summaryrefslogtreecommitdiffstats
path: root/xlators/performance/open-behind/src/open-behind-mem-types.h
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2018-07-01 06:43:51 +0530
committerRaghavendra G <rgowdapp@redhat.com>2018-08-03 14:47:03 +0000
commit7959147cfa75b3dd0320090e2173bb90930788e7 (patch)
tree65bc98ab6cc75e4f6e3a18276e3b0dc4a0f93478 /xlators/performance/open-behind/src/open-behind-mem-types.h
parent93d7f3f2da52b6fb513ad2ff91c5bd0589d1482b (diff)
performance/ob: stringent synchronization between rename/unlink and open
Issue 1: ======== open all pending fds before resuming rename and unlink currently ob uses fd_lookup to find out the opened-behind. But, fd_lookup gives the recent fd opened on the inode, but the oldest fd(s) (there can be multiple fds opened-behind when the very first opens on an inode are issued in parallel) are the candidates for fds with pending opens on backend. So, this patch explictily tracks the opened-behind fds on an inode and opens them before resuming rename or unlink. similar code changes are also done for setattr and setxattr to make sure pending opens are complete before permission change. This patch also adds a check for an open-in-progress to ob_get_wind_fd. If there is already an open-in-progress, ob_get_wind_fd won't return an anonymous fd as a result. This is done to make sure that rename/unlink/setattr/setxattr don't race with an operation like readv/fstat on an anonymous fd already in progress. Issue 2: ======== once renamed/unlinked, don't open-behind any future opens on the same inode. Issue 3: ======== Don't use anonymous fds by default. Note that rename/unlink can race with a read/fd on anonymous fds and these operations can fail with ESTALE. So, for better consistency in default mode, don't use anonymous fds. If performance is needed with tradeoff of consistency, one can switch on the option "use-anonymous-fd" Change-Id: Iaf130db71ce61ac37269f422e348a45f6ae6e82c Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Updates: bz#1512691
Diffstat (limited to 'xlators/performance/open-behind/src/open-behind-mem-types.h')
-rw-r--r--xlators/performance/open-behind/src/open-behind-mem-types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/performance/open-behind/src/open-behind-mem-types.h b/xlators/performance/open-behind/src/open-behind-mem-types.h
index 1e94296f424..8ddd061a835 100644
--- a/xlators/performance/open-behind/src/open-behind-mem-types.h
+++ b/xlators/performance/open-behind/src/open-behind-mem-types.h
@@ -16,6 +16,7 @@
enum gf_ob_mem_types_ {
gf_ob_mt_fd_t = gf_common_mt_end + 1,
gf_ob_mt_conf_t,
+ gf_ob_mt_inode_t,
gf_ob_mt_end
};
#endif