diff options
| author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-01-23 17:40:40 +0530 |
|---|---|---|
| committer | Niels de Vos <ndevos@redhat.com> | 2017-03-11 12:22:35 -0500 |
| commit | f9aaa26332ba7007265967bc29a1a2a99234a26d (patch) | |
| tree | cfab1d887c604dd70f797aead77e763382bc7e2c /xlators/storage/posix/src/posix-handle.c | |
| parent | a671a19d660dabad4292a2fbb190ee26a13a1532 (diff) | |
storage/posix: Execute syscalls in xattrop under different locks
Backport of: https://review.gluster.org/16462 and
https://review.gluster.org/16792
... 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>
(cherry picked from commit b5c26a462caf97bfc5380c81092f5c331ccaf1ae)
Change-Id: I2054a06701ecab11aed1c04e80ee57bbe2e52564
BUG: 1427390
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://review.gluster.org/16777
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.c')
| -rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index ddafb0d9b04..d3f48f859bf 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -940,6 +940,7 @@ posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid, char *real_path, inode_t *inode = NULL; struct stat stbuf = {0,}; struct posix_private *priv = NULL; + posix_inode_ctx_t *ctx = NULL; priv = this->private; @@ -961,12 +962,14 @@ posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid, char *real_path, LOCK (&inode->lock); { - ret = __inode_ctx_get0 (inode, this, &ctx_int); + ret = __posix_inode_ctx_get_all (inode, this, &ctx); if (ret) goto unlock; - if (ctx_int != GF_UNLINK_TRUE) + if (ctx->unlink_flag != GF_UNLINK_TRUE) { + ret = -1; goto unlock; + } POSIX_GET_FILE_UNLINK_PATH (priv->base_path, gfid, unlink_path); @@ -985,7 +988,8 @@ posix_create_link_if_gfid_exists (xlator_t *this, uuid_t gfid, char *real_path, goto unlock; } ctx_int = GF_UNLINK_FALSE; - ret = __inode_ctx_set0 (inode, this, &ctx_int); + ret = __posix_inode_ctx_set_unlink_flag (inode, this, + ctx_int); } unlock: UNLOCK (&inode->lock); |
