diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-01-23 17:40:40 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-02-27 03:26:42 -0500 |
commit | b5c26a462caf97bfc5380c81092f5c331ccaf1ae (patch) | |
tree | 8828f7bd3d08b6d5294ce915a5592c15bf630c88 /xlators/storage/posix/src/posix.h | |
parent | 8aee74f25cfa9dc676e116e9882723254b0509a9 (diff) |
storage/posix: Execute syscalls in xattrop under different locks
... and not inode->lock. This is to prevent the epoll thread from
*potentially* being blocked on this lock in the worst case for
extended period elsewhere in the brick stack, while the syscalls
in xattrop are being performed under the same lock by a different
thread. This could potentially lead to ping-timeout, if the only
available epoll thread is busy waiting on the inode->lock, thereby
preventing it from picking up the ping request from the client(s).
Also removed some unused functions.
Change-Id: I2054a06701ecab11aed1c04e80ee57bbe2e52564
BUG: 1421938
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://review.gluster.org/16462
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/storage/posix/src/posix.h')
-rw-r--r-- | xlators/storage/posix/src/posix.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.h b/xlators/storage/posix/src/posix.h index 87f91e57747..e6304250d14 100644 --- a/xlators/storage/posix/src/posix.h +++ b/xlators/storage/posix/src/posix.h @@ -190,6 +190,11 @@ typedef struct { int32_t op_errno; } posix_xattr_filler_t; +typedef struct { + uint64_t unlink_flag; + pthread_mutex_t xattrop_lock; +} posix_inode_ctx_t; + #define POSIX_BASE_PATH(this) (((struct posix_private *)this->private)->base_path) #define POSIX_BASE_PATH_LEN(this) (((struct posix_private *)this->private)->base_path_length) @@ -217,8 +222,17 @@ typedef struct { /* Helper functions */ -int posix_inode_ctx_get (inode_t *inode, xlator_t *this, uint64_t *ctx); -int posix_inode_ctx_set (inode_t *inode, xlator_t *this, uint64_t ctx); +int posix_inode_ctx_set_unlink_flag (inode_t *inode, xlator_t *this, + uint64_t ctx); + +int posix_inode_ctx_get_all (inode_t *inode, xlator_t *this, + posix_inode_ctx_t **ctx); + +int __posix_inode_ctx_set_unlink_flag (inode_t *inode, xlator_t *this, + uint64_t ctx); + +int __posix_inode_ctx_get_all (inode_t *inode, xlator_t *this, + posix_inode_ctx_t **ctx); int posix_gfid_set (xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req); |