diff options
-rw-r--r-- | libglusterfs/src/protocol.h | 2 | ||||
-rw-r--r-- | libglusterfs/src/stack.h | 1 | ||||
-rw-r--r-- | xlators/features/locks/src/common.c | 12 | ||||
-rw-r--r-- | xlators/features/locks/src/inodelk.c | 15 | ||||
-rw-r--r-- | xlators/protocol/client/src/client-protocol.c | 1 | ||||
-rw-r--r-- | xlators/protocol/server/src/server-protocol.c | 1 |
6 files changed, 23 insertions, 9 deletions
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h index 450e38731c2..3b5b3087f9f 100644 --- a/libglusterfs/src/protocol.h +++ b/libglusterfs/src/protocol.h @@ -977,6 +977,8 @@ typedef struct { * in gid. */ uint32_t groups[GF_REQUEST_MAXGROUPS]; + + uint64_t lk_owner; } __attribute__ ((packed)) gf_hdr_req_t; diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 722651a4c9d..cad7f79bec2 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -266,6 +266,7 @@ copy_frame (call_frame_t *frame) newstack->frames.this = frame->this; newstack->frames.root = newstack; newstack->pool = oldstack->pool; + newstack->lk_owner = oldstack->lk_owner; LOCK_INIT (&newstack->frames.lock); diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 17be81ff24c..f535845929a 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -782,9 +782,10 @@ __grant_blocked_locks (xlator_t *this, pl_inode_t *pl_inode, struct list_head *g posix_lock_to_flock (l, &conf->user_flock); gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => Granted", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Granted", l->fl_type == F_UNLCK ? "Unlock" : "Lock", l->client_pid, + l->owner, l->user_flock.l_start, l->user_flock.l_len); @@ -841,17 +842,19 @@ pl_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock, { if (__is_lock_grantable (pl_inode, lock)) { gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => OK", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => OK", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); __insert_and_merge (pl_inode, lock); } else if (can_block) { gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); lock->blocked = 1; @@ -859,9 +862,10 @@ pl_setlk (xlator_t *this, pl_inode_t *pl_inode, posix_lock_t *lock, ret = -1; } else { gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => NOK", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => NOK", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); errno = EAGAIN; diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index f92717c9b10..860f038bac2 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -214,9 +214,10 @@ __lock_inodelk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock, list_add_tail (&lock->blocked_locks, &dom->blocked_inodelks); gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); @@ -234,9 +235,10 @@ __lock_inodelk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock, gf_log (this->name, GF_LOG_TRACE, "Lock is grantable, but blocking to prevent starvation"); gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => Blocked", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Blocked", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); @@ -320,9 +322,10 @@ __grant_blocked_inode_locks (xlator_t *this, pl_inode_t *pl_inode, pl_dom_list_t if (bl_ret == 0) { gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => Granted", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => Granted", bl->fl_type == F_UNLCK ? "Unlock" : "Lock", bl->client_pid, + bl->owner, bl->user_flock.l_start, bl->user_flock.l_len); @@ -451,17 +454,19 @@ pl_inode_setlk (xlator_t *this, pl_inode_t *pl_inode, pl_inode_lock_t *lock, ret = __lock_inodelk (this, pl_inode, lock, can_block, dom); if (ret == 0) gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => OK", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => OK", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->fl_start, lock->fl_end); if (ret == -EAGAIN) gf_log (this->name, GF_LOG_TRACE, - "%s (pid=%d) %"PRId64" - %"PRId64" => NOK", + "%s (pid=%d) lk-owner:%"PRIu64" %"PRId64" - %"PRId64" => NOK", lock->fl_type == F_UNLCK ? "Unlock" : "Lock", lock->client_pid, + lock->owner, lock->user_flock.l_start, lock->user_flock.l_len); diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index 3ad41009c05..9deb691e8be 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -590,6 +590,7 @@ protocol_client_xfer (call_frame_t *frame, xlator_t *this, transport_t *trans, hdr->req.uid = hton32 (frame->root->uid); hdr->req.gid = hton32 (frame->root->gid); hdr->req.pid = hton32 (frame->root->pid); + hdr->req.lk_owner = hton64 (frame->root->lk_owner); client_encode_groups (frame, hdr); } diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 94a1ded3270..9dc6e118453 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -6154,6 +6154,7 @@ get_frame_for_call (transport_t *trans, gf_hdr_common_t *hdr) frame->root->unique = ntoh64 (hdr->callid); /* which call */ frame->root->gid = ntoh32 (hdr->req.gid); frame->root->pid = ntoh32 (hdr->req.pid); + frame->root->lk_owner = ntoh64 (hdr->req.lk_owner); server_decode_groups (frame, hdr); return frame; |