diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2019-04-01 11:14:56 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-04-26 06:51:24 +0000 |
commit | a9143223c515b82f6382f1372dfbdc0439dba198 (patch) | |
tree | d04a656ed522d6ad0e2ddcd4b2ed15beb30cf449 /xlators/features/locks/src/common.h | |
parent | edeb0d6e616cf4750ea9f6b6245631de8db233cf (diff) | |
download | glusterfs-a9143223c515b82f6382f1372dfbdc0439dba198.tar.gz glusterfs-a9143223c515b82f6382f1372dfbdc0439dba198.tar.xz glusterfs-a9143223c515b82f6382f1372dfbdc0439dba198.zip |
features/locks: error-out {inode,entry}lk fops with all-zero lk-owner
Problem:
Sometimes we find that developers forget to assign lk-owner for an
inodelk/entrylk/lk before writing code to wind these fops. locks
xlator at the moment allows this operation. This leads to multiple
threads in the same client being able to get locks on the inode
because lk-owner is same and transport is same. So isolation
with locks can't be achieved.
Fix:
Disallow locks with lk-owner zero.
fixes bz#1624701
Change-Id: I1aadcfbaaa4d49308f7c819505857e201809b3bc
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/common.h')
-rw-r--r-- | xlators/features/locks/src/common.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h index 3a7496758a..55603ef9c4 100644 --- a/xlators/features/locks/src/common.h +++ b/xlators/features/locks/src/common.h @@ -51,7 +51,8 @@ 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 can_block); + gf_lkowner_t *owner, fd_t *fd, uint32_t lk_flags, int blocking, + int32_t *op_errno); pl_inode_t * pl_inode_get(xlator_t *this, inode_t *inode, pl_local_t *local); @@ -212,4 +213,6 @@ pl_clean_local(pl_local_t *local); int pl_local_init(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd); +gf_boolean_t +pl_is_lk_owner_valid(gf_lkowner_t *owner, client_t *client); #endif /* __COMMON_H__ */ |