From cae022b3154b5688d51a8b3739cf8954222a07dd Mon Sep 17 00:00:00 2001 From: bobijam Date: Thu, 4 Sep 2008 02:23:29 +0000 Subject: [PATCH] Branch b1_6 b=16561 i=Oleg Drokin (green) i=johann Description: Hitting mdc_commit_close() ASSERTION Details : Properly handle request reference release in ll_release_openhandle(). --- lustre/ChangeLog | 8 +++++- lustre/llite/file.c | 73 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 6f37274..a8dc12b 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -38,6 +38,12 @@ tbd Sun Microsystems, Inc. * Output of lfs quota has been made less detailed by default, old (verbose) output can be obtained by using -v option. +Severity : major +Bugzilla : 16561 +Description: Hitting mdc_commit_close() ASSERTION +Details : Properly handle request reference release in + ll_release_openhandle(). + Severity : normal Bugzilla : 15927 Frequency : rare @@ -47,7 +53,7 @@ Description: replace ptlrpcd with the statahead thread to interpret the async Severity : normal Bugzilla : 16611 Frequency : on recovery -Description: I/O failures after umount during fail back +Description: I/O failures after umount during fail back Details : if client reconnected to restarted server we need join to recovery instead of find server handler is changed and process self eviction with cancel all locks. diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 226983c..c6567c8 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -273,7 +273,7 @@ int ll_file_release(struct inode *inode, struct file *file) ll_file_data_put(fd); RETURN(0); } - + if (lsm) lov_test_and_clear_async_rc(lsm); lli->lli_async_rc = 0; @@ -319,7 +319,7 @@ static int ll_intent_file_open(struct file *file, void *lmm, /* reason for keep own exit path - don`t flood log * with messages with -ESTALE errors. */ - if (!it_disposition(itp, DISP_OPEN_OPEN) || + if (!it_disposition(itp, DISP_OPEN_OPEN) || it_open_error(DISP_OPEN_OPEN, itp)) GOTO(out, rc); ll_release_openhandle(file->f_dentry, itp); @@ -435,7 +435,7 @@ int ll_file_open(struct inode *inode, struct file *file) * "lli->lli_opendir_pid != 0" means someone has set it. * "lli->lli_sai != NULL" means the previous statahead has not * been cleanup. - */ + */ if (lli->lli_opendir_pid == 0 && lli->lli_sai == NULL) { opendir_set = 1; lli->lli_opendir_pid = cfs_curproc_pid(); @@ -508,9 +508,9 @@ restart: up(&lli->lli_och_sem); ll_file_data_put(fd); GOTO(out_openerr, rc); - } + } ll_release_openhandle(file->f_dentry, it); - lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, + lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_OPEN); } (*och_usecount)++; @@ -537,7 +537,7 @@ restart: file->f_dentry->d_inode); goto restart; } - + OBD_ALLOC(*och_p, sizeof (struct obd_client_handle)); if (!*och_p) { ll_file_data_put(fd); @@ -681,7 +681,7 @@ check: void ll_pin_extent_cb(void *data) { struct page *page = data; - + page_cache_get(page); return; @@ -922,9 +922,9 @@ int ll_glimpse_ioctl(struct ll_sb_info *sbi, struct lov_stripe_md *lsm, struct obd_info oinfo = { { { 0 } } }; struct ost_lvb lvb; int rc; - + ENTRY; - + einfo.ei_type = LDLM_EXTENT; einfo.ei_mode = LCK_PR; einfo.ei_cb_bl = osc_extent_blocking_cb; @@ -945,7 +945,7 @@ int ll_glimpse_ioctl(struct ll_sb_info *sbi, struct lov_stripe_md *lsm, "returning -EIO\n", rc); RETURN(rc > 0 ? -EIO : rc); } - + lov_stripe_lock(lsm); memset(&lvb, 0, sizeof(lvb)); obd_merge_lvb(sbi->ll_osc_exp, lsm, &lvb, 0); @@ -955,7 +955,7 @@ int ll_glimpse_ioctl(struct ll_sb_info *sbi, struct lov_stripe_md *lsm, st->st_atime = lvb.lvb_atime; st->st_ctime = lvb.lvb_ctime; lov_stripe_unlock(lsm); - + RETURN(rc); } @@ -1203,7 +1203,7 @@ out: /* XXX: exact copy from kernel code (__generic_file_aio_write_nolock from rhel4) */ -static size_t ll_file_get_iov_count(const struct iovec *iov, +static size_t ll_file_get_iov_count(const struct iovec *iov, unsigned long *nr_segs) { size_t count = 0; @@ -1493,7 +1493,7 @@ repeat: nrsegs_orig = nr_segs; OBD_ALLOC(iov_copy, sizeof(*iov) * nr_segs); if (!iov_copy) - GOTO(out, retval = -ENOMEM); + GOTO(out, retval = -ENOMEM); } iov_copy_update(&nr_segs, &iov, &nrsegs_copy, iov_copy, @@ -1661,7 +1661,7 @@ static ssize_t ll_file_aio_write(struct kiocb *iocb, const struct iovec *iov, CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n", inode->i_ino, inode->i_generation, inode, count, *ppos); - + SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */ /* POSIX, but surprised the VFS doesn't check this already */ @@ -1690,7 +1690,7 @@ repeat: } else if (sbi->ll_max_rw_chunk != 0) { /* first, let's know the end of the current stripe */ end = *ppos; - obd_extent_calc(sbi->ll_osc_exp, lsm, OBD_CALC_STRIPE_END, + obd_extent_calc(sbi->ll_osc_exp, lsm, OBD_CALC_STRIPE_END, (obd_off *)&end); /* correct, the end is beyond the request */ @@ -1714,7 +1714,7 @@ repeat: nrsegs_orig = nr_segs; OBD_ALLOC(iov_copy, sizeof(*iov) * nr_segs); if (!iov_copy) - GOTO(out, retval = -ENOMEM); + GOTO(out, retval = -ENOMEM); } iov_copy_update(&nr_segs, &iov, &nrsegs_copy, iov_copy, &iov_offset, chunk); @@ -2003,8 +2003,8 @@ out_req_free: goto out; } -int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, - struct lov_mds_md **lmmp, int *lmm_size, +int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, + struct lov_mds_md **lmmp, int *lmm_size, struct ptlrpc_request **request) { struct ll_sb_info *sbi = ll_i2sbi(inode); @@ -2421,6 +2421,15 @@ cleanup: RETURN(rc); } +/** + * Close inode open handle + * + * \param dentry [in] dentry which contains the inode + * \param it [in,out] intent which contains open info and result + * + * \retval 0 success + * \retval <0 failure + */ int ll_release_openhandle(struct dentry *dentry, struct lookup_intent *it) { struct inode *inode = dentry->d_inode; @@ -2451,8 +2460,10 @@ int ll_release_openhandle(struct dentry *dentry, struct lookup_intent *it) OBD_FREE(och, sizeof(*och)); out: /* this one is in place of ll_file_open */ - ptlrpc_req_finished(it->d.lustre.it_data); - it_clear_disposition(it, DISP_ENQ_OPEN_REF); + if (it_disposition(it, DISP_ENQ_OPEN_REF)) { + ptlrpc_req_finished(it->d.lustre.it_data); + it_clear_disposition(it, DISP_ENQ_OPEN_REF); + } RETURN(rc); } @@ -2652,7 +2663,7 @@ error: default: { int err; - if (LLIOC_STOP == + if (LLIOC_STOP == ll_iocontrol_call(inode, file, cmd, arg, &err)) RETURN(err); @@ -2958,7 +2969,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it) rc = ll_inode_revalidate_fini(inode, rc); GOTO (out, rc); } - + rc = revalidate_it_finish(req, DLM_REPLY_REC_OFF, &oit, dentry); if (rc != 0) { ll_intent_release(&oit); @@ -2985,8 +2996,8 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it) if (S_ISREG(inode->i_mode)) { rc = ll_get_max_mdsize(sbi, &ealen); - if (rc) - RETURN(rc); + if (rc) + RETURN(rc); valid |= OBD_MD_FLEASIZE | OBD_MD_FLMODEASIZE; } ll_inode2fid(&fid, inode); @@ -3003,7 +3014,7 @@ int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it) } /* if object not yet allocated, don't validate size */ - if (ll_i2info(inode)->lli_smd == NULL) + if (ll_i2info(inode)->lli_smd == NULL) GOTO(out, rc = 0); /* ll_glimpse_size will prefer locally cached writes if they extend @@ -3180,7 +3191,7 @@ struct file_operations ll_file_operations_flock = { .write = ll_file_write, #ifdef HAVE_FILE_WRITEV .writev = ll_file_writev, -#else +#else .aio_write = ll_file_aio_write, #endif .ioctl = ll_file_ioctl, @@ -3209,7 +3220,7 @@ struct file_operations ll_file_operations_noflock = { .write = ll_file_write, #ifdef HAVE_FILE_WRITEV .writev = ll_file_writev, -#else +#else .aio_write = ll_file_aio_write, #endif .ioctl = ll_file_ioctl, @@ -3249,8 +3260,8 @@ struct inode_operations ll_file_inode_operations = { static struct llioc_ctl_data { struct rw_semaphore ioc_sem; struct list_head ioc_head; -} llioc = { - __RWSEM_INITIALIZER(llioc.ioc_sem), +} llioc = { + __RWSEM_INITIALIZER(llioc.ioc_sem), CFS_LIST_HEAD_INIT(llioc.ioc_head) }; @@ -3318,7 +3329,7 @@ void ll_iocontrol_unregister(void *magic) EXPORT_SYMBOL(ll_iocontrol_register); EXPORT_SYMBOL(ll_iocontrol_unregister); -enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file, +enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, int *rcp) { enum llioc_iter ret = LLIOC_CONT; @@ -3328,7 +3339,7 @@ enum llioc_iter ll_iocontrol_call(struct inode *inode, struct file *file, down_read(&llioc.ioc_sem); list_for_each_entry(data, &llioc.ioc_head, iocd_list) { for (i = 0; i < data->iocd_count; i++) { - if (cmd != data->iocd_cmd[i]) + if (cmd != data->iocd_cmd[i]) continue; ret = data->iocd_cb(inode, file, cmd, arg, data, &rc); -- 1.8.3.1