diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2019-04-16 22:14:47 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2019-04-17 08:17:29 +0000 |
commit | 785f3276d2e325a991b64aed66a326ea95fffef3 (patch) | |
tree | 0ccd327225b01e4d3eba2d26051dfe6ff7f335df /xlators/features/locks/src/common.c | |
parent | b922793588ad23a9b12ce65abd29e8f45ac87998 (diff) | |
download | glusterfs-785f3276d2e325a991b64aed66a326ea95fffef3.tar.gz glusterfs-785f3276d2e325a991b64aed66a326ea95fffef3.tar.xz glusterfs-785f3276d2e325a991b64aed66a326ea95fffef3.zip |
Revert "features/locks: error-out {inode,entry}lk fops with all-zero lk-owner"
This reverts commit 3883887427a7f2dc458a9773e05f7c8ce8e62301 as it has
broken sdfs-sanity.t.
Updates: bz#1624701
Change-Id: Icb2b0d6bfcce4d556f1cd0f11695c03ffc138736
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/common.c')
-rw-r--r-- | xlators/features/locks/src/common.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index ccb23e2250..6e7fb4b2f6 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -493,8 +493,7 @@ unlock: /* Create a new posix_lock_t */ posix_lock_t * new_posix_lock(struct gf_flock *flock, client_t *client, pid_t client_pid, - gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags, int blocking, - int32_t *op_errno) + gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags, int blocking) { posix_lock_t *lock = NULL; @@ -502,14 +501,8 @@ new_posix_lock(struct gf_flock *flock, client_t *client, pid_t client_pid, GF_VALIDATE_OR_GOTO("posix-locks", client, out); GF_VALIDATE_OR_GOTO("posix-locks", fd, out); - if (!pl_is_lk_owner_valid(owner, client)) { - *op_errno = EINVAL; - goto out; - } - lock = GF_CALLOC(1, sizeof(posix_lock_t), gf_locks_mt_posix_lock_t); if (!lock) { - *op_errno = ENOMEM; goto out; } @@ -527,7 +520,6 @@ new_posix_lock(struct gf_flock *flock, client_t *client, pid_t client_pid, if (lock->client_uid == NULL) { GF_FREE(lock); lock = NULL; - *op_errno = ENOMEM; goto out; } @@ -996,7 +988,6 @@ pl_send_prelock_unlock(xlator_t *this, pl_inode_t *pl_inode, 0, }; posix_lock_t *unlock_lock = NULL; - int32_t op_errno = 0; struct list_head granted_list; posix_lock_t *tmp = NULL; @@ -1014,7 +1005,7 @@ pl_send_prelock_unlock(xlator_t *this, pl_inode_t *pl_inode, unlock_lock = new_posix_lock(&flock, old_lock->client, old_lock->client_pid, &old_lock->owner, old_lock->fd, - old_lock->lk_flags, 0, &op_errno); + old_lock->lk_flags, 0); GF_VALIDATE_OR_GOTO(this->name, unlock_lock, out); ret = 0; @@ -1281,17 +1272,4 @@ pl_local_init(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd) } return 0; -} - -gf_boolean_t -pl_is_lk_owner_valid(gf_lkowner_t *owner, client_t *client) -{ - if (client && (client->opversion < GD_OP_VERSION_7_0)) { - return _gf_true; - } - - if (is_lk_owner_null(owner)) { - return _gf_false; - } - return _gf_true; -} +}
\ No newline at end of file |