Whamcloud - gitweb
LU-2645 ldlm: use correct lvb size to reply 1.8 lock enqueue
authorFan Yong <yong.fan@whamcloud.com>
Tue, 5 Feb 2013 16:38:04 +0000 (00:38 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 5 Mar 2013 15:18:55 +0000 (10:18 -0500)
For 1.8 client, it does not support variable-sized LVB.
The 2.4 server should correctly distinguish whether the
client support it or not, and fill the reply buffer with
suitable LVB size when processing lock enqueue.

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes \
clientjob=lustre-b1_8 clientbuildno=256 testlist=runtests

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I9241efe25dc64b26e86c4e75da72ab74bb1bc750
Reviewed-on: http://review.whamcloud.com/5459
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ofd/ofd_lvb.c

index edadc69..be22922 100644 (file)
@@ -281,7 +281,13 @@ static int ofd_lvbo_size(struct ldlm_lock *lock)
 static int ofd_lvbo_fill(struct ldlm_lock *lock, void *buf, int buflen)
 {
        struct ldlm_resource *res = lock->l_resource;
-       int lvb_len = min_t(int, res->lr_lvb_len, buflen);
+       int lvb_len;
+
+       lvb_len = ofd_lvbo_size(lock);
+       LASSERT(lvb_len <= res->lr_lvb_len);
+
+       if (lvb_len > buflen)
+               lvb_len = buflen;
 
        lock_res(res);
        memcpy(buf, res->lr_lvb_data, lvb_len);