lustre/ldlm: set l_lvb_type coherent when layout is returned
authorBruno Faccini <bruno.faccini@intel.com>
Sat, 1 Mar 2014 02:16:39 +0000 (21:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Mar 2014 03:11:20 +0000 (19:11 -0800)
In case layout has been packed into server reply when not
requested, lock l_lvb_type must be set accordingly.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Reviewed-on: http://review.whamcloud.com/8270
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4194
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
drivers/staging/lustre/lustre/mdc/mdc_locks.c

index 3ed020eb89c03a27f0c213d7943e8baf8f07bbce..d87048dcc70c25cec635dbbb278d37f5146fed7a 100644 (file)
@@ -228,6 +228,7 @@ static void ldlm_handle_cp_callback(struct ptlrpc_request *req,
 
                        lock_res_and_lock(lock);
                        LASSERT(lock->l_lvb_data == NULL);
+                       lock->l_lvb_type = LVB_T_LAYOUT;
                        lock->l_lvb_data = lvb_data;
                        lock->l_lvb_len = lvb_len;
                        unlock_res_and_lock(lock);
index 81adc2b8298706553d6a9ac7feff07a14eb90ee2..b0d0e2a1744ef8e8a738a9af3395517679111ed1 100644 (file)
@@ -753,6 +753,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
                /* install lvb_data */
                lock_res_and_lock(lock);
                if (lock->l_lvb_data == NULL) {
+                       lock->l_lvb_type = LVB_T_LAYOUT;
                        lock->l_lvb_data = lmm;
                        lock->l_lvb_len = lvb_len;
                        lmm = NULL;