From: adilger Date: Sat, 3 Apr 2004 19:27:21 +0000 (+0000) Subject: Initialize lock handle so that we don't fail ASSERT on error cleanup. X-Git-Tag: v1_8_0_110~486^6~25 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=0ddc239760baffe7d133ec7aaaf0473035f7eff3;p=fs%2Flustre-release.git Initialize lock handle so that we don't fail ASSERT on error cleanup. b=3057 r=phil --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index a0c33b6..598fba1 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -8,6 +8,7 @@ tbd Cluster File Systems, Inc. - update client's i_blocks count via lvb messages (2543) - handle intent open/close of special files properly (1557) - mount MDS with errors=remount-ro, like obdfilter (2009) + - initialize lock handle to avoid ASSERT on error cleanup (3057) * miscellania - allow default OST striping configuration per directory (1414) diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 1894e79..a737a14 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -75,13 +75,12 @@ static int llu_extent_lock_callback(struct ldlm_lock *lock, struct lustre_handle lockh = { 0 }; int rc; ENTRY; - if ((unsigned long)data > 0 && (unsigned long)data < 0x1000) { LDLM_ERROR(lock, "cancelling lock with bad data %p", data); LBUG(); } - + switch (flag) { case LDLM_CB_BLOCKING: ldlm_lock2handle(lock, &lockh); @@ -182,7 +181,7 @@ int llu_glimpse_size(struct inode *inode, struct ost_lvb *lvb) struct llu_inode_info *lli = llu_i2info(inode); struct llu_sb_info *sbi = llu_i2sbi(inode); ldlm_policy_data_t policy = { .l_extent = { 0, OBD_OBJECT_EOF } }; - struct lustre_handle lockh; + struct lustre_handle lockh = { 0 }; int rc, flags = LDLM_FL_HAS_INTENT; ENTRY; diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 23fac76..7456393 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -123,7 +123,7 @@ static int ll_intent_file_open(struct file *file, void *lmm, ll_prepare_mdc_op_data(&data, parent->d_inode, NULL, name, len, O_RDWR); - rc = mdc_enqueue(sbi->ll_mdc_exp, LDLM_PLAIN, itp, LCK_PR, &data, + rc = mdc_enqueue(sbi->ll_mdc_exp, LDLM_PLAIN, itp, LCK_PW, &data, &lockh, lmm, lmmsize, ldlm_completion_ast, ll_mdc_blocking_ast, parent->d_inode); if (rc < 0) @@ -613,7 +613,7 @@ int ll_glimpse_size(struct inode *inode, struct ost_lvb *lvb) struct ll_inode_info *lli = ll_i2info(inode); struct ll_sb_info *sbi = ll_i2sbi(inode); ldlm_policy_data_t policy = { .l_extent = { 0, OBD_OBJECT_EOF } }; - struct lustre_handle lockh; + struct lustre_handle lockh = { 0 }; int rc, flags = LDLM_FL_HAS_INTENT; ENTRY;