diff options
| -rw-r--r-- | libglusterfs/src/lkowner.h | 19 | ||||
| -rw-r--r-- | xlators/features/marker/src/marker.c | 3 | 
2 files changed, 22 insertions, 0 deletions
diff --git a/libglusterfs/src/lkowner.h b/libglusterfs/src/lkowner.h index 78f54a628d1..c3e16760869 100644 --- a/libglusterfs/src/lkowner.h +++ b/libglusterfs/src/lkowner.h @@ -75,4 +75,23 @@ is_same_lkowner (gf_lkowner_t *l1, gf_lkowner_t *l2)          return ((l1->len == l2->len) && !memcmp(l1->data, l2->data, l1->len));  } +static inline int +is_lk_owner_null (gf_lkowner_t *lkowner) +{ +        int is_null = 1; +        int i       = 0; + +        if (lkowner == NULL || lkowner->len == 0) +                goto out; + +        for (i = 0; i < lkowner->len; i++) { +                if (lkowner->data[i] != 0) { +                        is_null = 0; +                        break; +                } +        } +out: +        return is_null; +} +  #endif /* _LK_OWNER_H */ diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 2943f3b067d..b5e41523747 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -1593,6 +1593,9 @@ marker_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,          local->xdata = dict_ref (xdata); +        if (is_lk_owner_null (&frame->root->lk_owner)) +                set_lk_owner_from_ptr (&frame->root->lk_owner, frame->root); +          STACK_WIND (frame,                      marker_rename_inodelk_cbk,                      FIRST_CHILD(this),  | 
