From: adilger Date: Mon, 4 Jul 2005 20:10:12 +0000 (+0000) Subject: Branch b1_4 X-Git-Tag: v1_7_140~1^12~3^2~55^5~110 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5fcac7388c6d3251a9fe351453712f8d14f3979d;p=fs%2Flustre-release.git Branch b1_4 Merge minor changes from b_cray - asm/types.h build fix for catamount - include linux/quota.h only conditionally - use FPRIVATE in llite group locking code - use ptlrpcd and ptlrpcd-recov names for threads - add flock, group tests to b1_4 CVS - use OPENIBNAL instead of IBNAL for llvisualize - update lmc usage message --- diff --git a/lustre/autoMakefile.am b/lustre/autoMakefile.am index 65f636b..6601c1c 100644 --- a/lustre/autoMakefile.am +++ b/lustre/autoMakefile.am @@ -32,7 +32,8 @@ endif SUBDIRS += $(LIBLUSTRE_SUBDIRS) endif -DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) $(LIBLUSTRE_SUBDIRS) +DIST_SUBDIRS := $(ALWAYS_SUBDIRS) $(SERVER_SUBDIRS) $(CLIENT_SUBDIRS) \ + $(LIBLUSTRE_SUBDIRS) EXTRA_DIST = BUGS FDL kernel_patches diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 6d639ec..12900dc 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -482,6 +482,7 @@ AC_CHECK_HEADERS([asm/page.h sys/user.h stdint.h]) # include/lustre/lustre_user.h # See note there re: __ASM_X86_64_PROCESSOR_H +AC_CHECK_HEADERS([linux/quota.h]) AC_CHECK_TYPES([struct if_dqinfo],[],[],[ #define __ASM_X86_64_PROCESSOR_H diff --git a/lustre/include/Makefile.am b/lustre/include/Makefile.am index f2c2d76..0bd0712 100644 --- a/lustre/include/Makefile.am +++ b/lustre/include/Makefile.am @@ -5,5 +5,5 @@ # See the file COPYING in this distribution SUBDIRS = linux lustre -EXTRA_DIST = ioctl.h liblustre.h +EXTRA_DIST = ioctl.h liblustre.h types.h diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 4467897..406f4c5 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -33,15 +33,19 @@ #ifndef _LUSTRE_IDL_H_ #define _LUSTRE_IDL_H_ +#ifdef HAVE_ASM_TYPES_H +#include +#else +#include "types.h" +#endif + #ifdef __KERNEL__ -# include # include -# include /* to check for FMODE_EXEC, lest we redefine */ +# include /* to check for FMODE_EXEC, dev_t, lest we redefine */ #else #ifdef __CYGWIN__ # include #else -# include # include #endif #endif diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index b2baf7e..13ad7f8 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -51,32 +51,6 @@ #endif #endif -#ifndef LPU64 -/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ -#if defined(__x86_64__) && defined(__KERNEL__) -# define LPU64 "%Lu" -# define LPD64 "%Ld" -# define LPX64 "%#Lx" -# define LPSZ "%lu" -# define LPSSZ "%ld" -#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32) -# define LPU64 "%Lu" -# define LPD64 "%Ld" -# define LPX64 "%#Lx" -# define LPSZ "%u" -# define LPSSZ "%d" -#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64) -# define LPU64 "%lu" -# define LPD64 "%ld" -# define LPX64 "%#lx" -# define LPSZ "%lu" -# define LPSSZ "%ld" -#endif -#ifndef LPU64 -# error "No word size defined" -#endif -#endif - /* target.c */ struct ptlrpc_request; struct recovd_data; diff --git a/lustre/include/linux/lustre_lite.h b/lustre/include/linux/lustre_lite.h index 094eafe..968187a 100644 --- a/lustre/include/linux/lustre_lite.h +++ b/lustre/include/linux/lustre_lite.h @@ -72,6 +72,7 @@ enum { #define LLAP_FROM_COOKIE(c) \ (LASSERT(((struct ll_async_page *)(c))->llap_magic == LLAP_MAGIC), \ (struct ll_async_page *)(c)) + #define LL_MAX_BLKSIZE (4UL * 1024 * 1024) #include diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index b3b23e8..ce1ebb0 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -80,7 +80,6 @@ struct mds_update_record { #define ur_cap ur_uc.luc_cap #define ur_suppgid1 ur_uc.luc_suppgid1 #define ur_suppgid2 ur_uc.luc_suppgid2 -#define ur_umask ur_uc.luc_umask #define MDS_LR_SERVER_SIZE 512 diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 98ae32e..248b15e 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -531,7 +531,7 @@ struct ptlrpc_service { struct list_head srv_history_rqbds; /* request buffer history */ int srv_n_history_rqbds; /* # request buffers in history */ int srv_max_history_rqbds; /* max # request buffers in history */ - + atomic_t srv_outstanding_replies; struct list_head srv_reply_queue; /* replies waiting for service */ diff --git a/lustre/include/linux/lvfs.h b/lustre/include/linux/lvfs.h index 2862b8d..c9604ff 100644 --- a/lustre/include/linux/lvfs.h +++ b/lustre/include/linux/lvfs.h @@ -30,7 +30,7 @@ #if defined __KERNEL__ #include -#endif +#endif #ifdef LIBLUSTRE #include diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index c2b72b3..fdfcf52 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -508,7 +508,7 @@ struct obd_device { int obd_minor; unsigned int obd_attached:1, obd_set_up:1, obd_recovering:1, obd_abort_recovery:1, obd_replayable:1, obd_no_transno:1, - obd_no_recov:1, obd_stopping:1, obd_starting:1, + obd_no_recov:1, obd_stopping:1, obd_starting:1, obd_force:1, obd_fail:1; atomic_t obd_refcount; wait_queue_head_t obd_refcount_waitq; diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 9c4b9e5..2d1696a 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -8,7 +8,16 @@ #ifndef _LUSTRE_USER_H #define _LUSTRE_USER_H + +#ifdef HAVE_ASM_TYPES_H #include +#else +#include "types.h" +#endif + +#ifdef HAVE_LINUX_QUOTA_H +#include +#endif /* * asm-x86_64/processor.h on some SLES 9 distros seems to use @@ -17,7 +26,6 @@ */ #define __ASM_X86_64_PROCESSOR_H -#include #ifdef __KERNEL__ #include #else @@ -213,4 +221,27 @@ struct if_quotactl { struct obd_uuid obd_uuid; }; +#ifndef LPU64 +/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ +#if defined(__x86_64__) && defined(__KERNEL__) +# define LPU64 "%Lu" +# define LPD64 "%Ld" +# define LPX64 "%#Lx" +# define LPSZ "%lu" +# define LPSSZ "%ld" +#elif (BITS_PER_LONG == 32 || __WORDSIZE == 32) +# define LPU64 "%Lu" +# define LPD64 "%Ld" +# define LPX64 "%#Lx" +# define LPSZ "%u" +# define LPSSZ "%d" +#elif (BITS_PER_LONG == 64 || __WORDSIZE == 64) +# define LPU64 "%lu" +# define LPD64 "%ld" +# define LPX64 "%#lx" +# define LPSZ "%lu" +# define LPSSZ "%ld" +#endif +#endif /* !LPU64 */ + #endif /* _LUSTRE_USER_H */ diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 0cd1240..ec35e3f 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -148,6 +148,7 @@ static void ldlm_extent_policy(struct ldlm_resource *res, /* Determine if the lock is compatible with all locks on the queue. * We stop walking the queue if we hit ourselves so we don't take * conflicting locks enqueued after us into accound, or we'd wait forever. + * * 0 if the lock is not compatible * 1 if the lock is compatible * 2 if this group lock is compatible and requires no further checking @@ -202,11 +203,11 @@ ldlm_extent_compat_queue(struct list_head *queue, struct ldlm_lock *req, /* locks are compatible, overlap doesn't matter */ if (lockmode_compat(lock->l_req_mode, req_mode)) { - /* non-group locks are compatible, overlap doesn't - matter */ + /* non-group locks are compatible, overlap doesn't + matter */ if (likely(req_mode != LCK_GROUP)) continue; - + /* If we are trying to get a GROUP lock and there is another one of this kind, we need to compare gid */ if (req->l_policy_data.l_extent.gid == diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 6728a31..3c5d6be 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -404,7 +404,7 @@ int client_connect_import(struct lustre_handle *dlm_handle, imp->imp_dlm_handle = *dlm_handle; rc = ptlrpc_init_import(imp); - if (rc != 0) + if (rc != 0) GOTO(out_ldlm, rc); if (data) @@ -1189,7 +1189,7 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc) LBUG(); memcpy(saved_req, req, sizeof *saved_req); memcpy(reqmsg, req->rq_reqmsg, req->rq_reqlen); - + /* Don't race cleanup */ spin_lock_bh(&obd->obd_processing_task_lock); if (obd->obd_stopping) { diff --git a/lustre/liblustre/file.c b/lustre/liblustre/file.c index b7f4b55..71a3548 100644 --- a/lustre/liblustre/file.c +++ b/lustre/liblustre/file.c @@ -147,7 +147,7 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode) if (llu_is_root_inode(inode)) RETURN(0); - CDEBUG(D_VFSTRACE, "VFS Op:inode=%llu\n", st->st_ino); + CDEBUG(D_VFSTRACE, "VFS Op:inode=%llu\n", (long long)st->st_ino); LL_GET_INTENT(inode, it); if (!it->d.lustre.it_disposition) { diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index a20e18c..e2e0180 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -203,7 +203,7 @@ static int llu_glimpse_callback(struct ldlm_lock *lock, void *reqp) lvb->lvb_size = lli->lli_smd->lsm_oinfo[stripe].loi_kms; LDLM_DEBUG(lock, "i_size: %llu -> stripe number %u -> kms "LPU64, - llu_i2stat(inode)->st_size, stripe, lvb->lvb_size); + (long long)llu_i2stat(inode)->st_size, stripe,lvb->lvb_size); iput: I_RELE(inode); out: @@ -228,7 +228,7 @@ int llu_glimpse_size(struct inode *inode) int rc, flags = LDLM_FL_HAS_INTENT; ENTRY; - CDEBUG(D_DLMTRACE, "Glimpsing inode %llu\n", st->st_ino); + CDEBUG(D_DLMTRACE, "Glimpsing inode %llu\n", (long long)st->st_ino); rc = obd_enqueue(sbi->ll_osc_exp, lli->lli_smd, LDLM_EXTENT, &policy, LCK_PR, &flags, llu_extent_lock_callback, @@ -241,10 +241,10 @@ int llu_glimpse_size(struct inode *inode) st->st_size = lov_merge_size(lli->lli_smd, 0); st->st_blocks = lov_merge_blocks(lli->lli_smd); - //lli->lli_st_mtime = lov_merge_mtime(lli->lli_smd, inode->i_mtime); + st->st_mtime = lov_merge_mtime(lli->lli_smd, st->st_mtime); CDEBUG(D_DLMTRACE, "glimpse: size: %llu, blocks: %llu\n", - st->st_size, st->st_blocks); + (long long)st->st_size, st->st_blocks); obd_cancel(sbi->ll_osc_exp, lli->lli_smd, LCK_PR, &lockh); @@ -269,7 +269,8 @@ int llu_extent_lock(struct ll_file_data *fd, struct inode *inode, RETURN(0); CDEBUG(D_DLMTRACE, "Locking inode %llu, start "LPU64" end "LPU64"\n", - st->st_ino, policy->l_extent.start, policy->l_extent.end); + (long long)st->st_ino, policy->l_extent.start, + policy->l_extent.end); rc = obd_enqueue(sbi->ll_osc_exp, lsm, LDLM_EXTENT, policy, mode, &ast_flags, llu_extent_lock_callback, @@ -282,7 +283,8 @@ int llu_extent_lock(struct ll_file_data *fd, struct inode *inode, policy->l_extent.end == OBD_OBJECT_EOF) st->st_size = lov_merge_size(lsm, 1); - //inode->i_mtime = lov_merge_mtime(lsm, inode->i_mtime); + if (rc == 0) + st->st_mtime = lov_merge_mtime(lsm, st->st_mtime); RETURN(rc); } diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index a6e63bc..f9d4924 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -309,8 +309,6 @@ int ll_readdir(struct file * filp, void * dirent, filldir_t filldir) if (pos > inode->i_size - EXT2_DIR_REC_LEN(1)) RETURN(0); - types = ext2_filetype_table; - for ( ; n < npages; n++, offset = 0) { char *kaddr, *limit; ext2_dirent *de; diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 9487a59..46f8d9b 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1098,7 +1098,7 @@ static int ll_lov_getstripe(struct inode *inode, unsigned long arg) static int ll_get_grouplock(struct inode *inode, struct file *file, unsigned long arg) { - struct ll_file_data *fd = file->private_data; + struct ll_file_data *fd = LUSTRE_FPRIVATE(file); ldlm_policy_data_t policy = { .l_extent = { .start = 0, .end = OBD_OBJECT_EOF}}; struct lustre_handle lockh = { 0 }; @@ -1129,7 +1129,7 @@ static int ll_get_grouplock(struct inode *inode, struct file *file, static int ll_put_grouplock(struct inode *inode, struct file *file, unsigned long arg) { - struct ll_file_data *fd = file->private_data; + struct ll_file_data *fd = LUSTRE_FPRIVATE(file); struct ll_inode_info *lli = ll_i2info(inode); struct lov_stripe_md *lsm = lli->lli_smd; int rc; @@ -1142,7 +1142,7 @@ static int ll_put_grouplock(struct inode *inode, struct file *file, if (fd->fd_gid != arg) /* Ugh? Unlocking with different gid? */ RETURN(-EINVAL); - + fd->fd_flags &= ~(LL_FILE_GROUP_LOCKED|LL_FILE_IGNORE_LOCK); rc = ll_extent_unlock(fd, inode, lsm, LCK_GROUP, &fd->fd_cwlockh); @@ -1153,7 +1153,7 @@ static int ll_put_grouplock(struct inode *inode, struct file *file, memset(&fd->fd_cwlockh, 0, sizeof(fd->fd_cwlockh)); RETURN(0); -} +} int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 48a166b..8908332 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -190,7 +190,7 @@ int ll_mdc_cancel_unused(struct lustre_handle *conn, struct inode *inode, { .name = {inode->i_ino, inode->i_generation} }; struct obd_device *obddev = class_conn2obd(conn); ENTRY; - + RETURN(ldlm_cli_cancel_unused(obddev->obd_namespace, &res_id, flags, opaque)); } diff --git a/lustre/lov/lov_log.c b/lustre/lov/lov_log.c index 6537be4..faa7bd1 100644 --- a/lustre/lov/lov_log.c +++ b/lustre/lov/lov_log.c @@ -88,7 +88,7 @@ static int lov_llog_origin_add(struct llog_ctxt *ctxt, } static int lov_llog_origin_connect(struct llog_ctxt *ctxt, int count, - struct llog_logid *logid, + struct llog_logid *logid, struct llog_gen *gen, struct obd_uuid *uuid) { @@ -136,7 +136,7 @@ static int lov_llog_repl_cancel(struct llog_ctxt *ctxt, struct lov_stripe_md *ls loi = lsm->lsm_oinfo; lov = &obd->u.lov; for (i = 0; i < count; i++, cookies++, loi++) { - struct obd_device *child = lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd; + struct obd_device *child = lov->tgts[loi->loi_ost_idx].ltd_exp->exp_obd; struct llog_ctxt *cctxt = llog_get_context(child, ctxt->loc_idx); int err; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 81ddfaf..c15be19 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -964,8 +964,8 @@ static int mds_readpage(struct ptlrpc_request *req) rc = lustre_pack_reply(req, 1, &size, NULL); if (rc) { - CERROR("mds: out of memory while packing readpage reply\n"); - RETURN(-ENOMEM); + CERROR("error packing readpage reply: rc %d\n", rc); + GOTO(out, rc); } body = lustre_swab_reqbuf(req, 0, sizeof(*body), lustre_swab_mds_body); @@ -1138,8 +1138,9 @@ int mds_handle(struct ptlrpc_request *req) int recovering, abort_recovery; if (req->rq_export == NULL) { - CERROR("lustre_mds: operation %d on unconnected MDS\n", - req->rq_reqmsg->opc); + CERROR("operation %d on unconnected MDS from %s\n", + req->rq_reqmsg->opc, + req->rq_peerstr); req->rq_status = -ENOTCONN; GOTO(out, rc = -ENOTCONN); } @@ -1610,7 +1611,7 @@ static int mds_postsetup(struct obd_device *obd) cfg.cfg_instance = NULL; cfg.cfg_uuid = mds->mds_lov_uuid; push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - rc = class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT), + rc = class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT), mds->mds_profile, &cfg); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); switch (rc) { @@ -1726,7 +1727,7 @@ int mds_lov_clean(struct obd_device *obd) cfg.cfg_uuid = mds->mds_lov_uuid; push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT), + class_config_parse_llog(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT), cln_prof, &cfg); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 45d0859..8488d63 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -184,8 +184,14 @@ int mds_client_free(struct obd_export *exp) LBUG(); } + + /* Make sure the server's last_transno is up to date. Do this + * after the client is freed so we know all the client's + * transactions have been committed. */ + mds_update_server_data(exp->exp_obd, 0); + EXIT; -free: + free: OBD_FREE(med->med_mcd, sizeof(*med->med_mcd)); med->med_mcd = NULL; @@ -677,7 +683,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa, void *handle; int err, namelen, rc = 0; ENTRY; - + memset(&ucred, 0, sizeof(ucred)); ucred.luc_cap = current->cap_effective | CAP_SYS_RESOURCE; push_ctxt(&saved, &obd->obd_lvfs_ctxt, &ucred); diff --git a/lustre/mds/mds_log.c b/lustre/mds/mds_log.c index b73b7d2..c024c41 100644 --- a/lustre/mds/mds_log.c +++ b/lustre/mds/mds_log.c @@ -191,7 +191,7 @@ static struct llog_operations mds_ost_orig_logops = { }; static struct llog_operations mds_size_repl_logops = { - lop_cancel: mds_llog_repl_cancel + lop_cancel: mds_llog_repl_cancel, }; int mds_llog_init(struct obd_device *obd, struct obd_device *tgt, diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 39cf431..f1cd617 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -366,7 +366,6 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, RETURN(0); } - if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_MDS_ALLOC_OBDO)) GOTO(out_ids, rc = -ENOMEM); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index a4960ae..bfe78d8 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -887,8 +887,7 @@ void oig_release(struct obd_io_group *oig) } EXPORT_SYMBOL(oig_release); -void oig_add_one(struct obd_io_group *oig, - struct oig_callback_context *occ) +void oig_add_one(struct obd_io_group *oig, struct oig_callback_context *occ) { unsigned long flags; CDEBUG(D_CACHE, "oig %p ready to roll\n", oig); diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 806788d..7ddbd0a 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -481,8 +481,10 @@ echo_client_page_debug_check(struct lov_stripe_md *lsm, rc2 = block_debug_check("test_brw", addr + delta, OBD_ECHO_BLOCK_SIZE, stripe_off, stripe_id); - if (rc2 != 0) + if (rc2 != 0) { + CERROR ("Error in echo object "LPX64"\n", id); rc = rc2; + } } kunmap(page); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 8117b51..b4a63d6 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1821,7 +1821,7 @@ int filter_setattr(struct obd_export *exp, struct obdo *oa, if (iattr.ia_valid & (ATTR_UID | ATTR_GID)) { orig_uid = dentry->d_inode->i_uid; orig_gid = dentry->d_inode->i_gid; - handle = fsfilt_start_log(exp->exp_obd, dentry->d_inode, + handle = fsfilt_start_log(exp->exp_obd, dentry->d_inode, FSFILT_OP_SETATTR, oti, 1); } else { handle = fsfilt_start(exp->exp_obd, dentry->d_inode, @@ -2093,12 +2093,12 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa, recreate_obj = 1; } else { OBD_ALLOC(osfs, sizeof(*osfs)); - if(osfs == NULL) + if (osfs == NULL) RETURN(-ENOMEM); rc = filter_statfs(obd, osfs, jiffies-HZ); - if(rc == 0 && osfs->os_bavail < (osfs->os_blocks >> 10)) { - CDEBUG(D_HA, "This OST has not enough space! avail "LPU64"\n", - osfs->os_bavail << filter->fo_sb->s_blocksize_bits); + if (rc == 0 && osfs->os_bavail < (osfs->os_blocks >> 10)) { + CDEBUG(D_HA, "OST out of space! avail "LPU64"\n", + osfs->os_bavail<fo_sb->s_blocksize_bits); *num=0; rc = -ENOSPC; } @@ -2698,10 +2698,8 @@ static int __init obdfilter_init(void) rc = class_register_type(&filter_obd_ops, lvars.module_vars, OBD_FILTER_DEVICENAME); - if (rc) { + if (rc) GOTO(out, rc); - return rc; - } rc = class_register_type(&filter_sanobd_ops, lvars.module_vars, OBD_FILTER_SAN_DEVICENAME); diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 3127e0b..b8d8ce5 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -124,7 +124,8 @@ static int osc_wr_max_dirty_mb(struct file *file, const char *buffer, if (rc) return rc; - if (val < 0 || val > OSC_MAX_DIRTY_MB_MAX || val > num_physpages / 4) + if (val < 0 || val > OSC_MAX_DIRTY_MB_MAX || + val > num_physpages >> (20 - PAGE_SHIFT - 2)) /* 1/4 of RAM */ return -ERANGE; spin_lock(&cli->cl_loi_list_lock); diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 7bdf0de..15cfbb0 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1275,7 +1275,7 @@ unlock: /* this is trying to propogate async writeback errors back up to the * application. As an async write fails we record the error code for later if - * the app does an fsync. as long as errors persist we force future rpcs to be + * the app does an fsync. As long as errors persist we force future rpcs to be * sync so that the app can get a sync error and break the cycle of queueing * pages for which writeback will fail. */ static void osc_process_ar(struct osc_async_rc *ar, struct ptlrpc_request *req, diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 16b6b04..c812d90 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -501,8 +501,11 @@ static int after_reply(struct ptlrpc_request *req) spin_lock_irqsave(&imp->imp_lock, flags); if (req->rq_transno != 0) ptlrpc_retain_replayable_request(req, imp); - else if (req->rq_commit_cb != NULL) + else if (req->rq_commit_cb != NULL) { + spin_unlock_irqrestore(&imp->imp_lock, flags); req->rq_commit_cb(req); + spin_lock_irqsave(&imp->imp_lock, flags); + } if (req->rq_transno > imp->imp_max_transno) imp->imp_max_transno = req->rq_transno; diff --git a/lustre/ptlrpc/ptlrpcd.c b/lustre/ptlrpc/ptlrpcd.c index 1c2b462..2b4ce05 100644 --- a/lustre/ptlrpc/ptlrpcd.c +++ b/lustre/ptlrpc/ptlrpcd.c @@ -58,6 +58,7 @@ struct ptlrpcd_ctl { struct list_head pc_req_list; wait_queue_head_t pc_waitq; struct ptlrpc_request_set *pc_set; + char pc_name[16]; #ifndef __KERNEL__ int pc_recurred; void *pc_callback; @@ -151,7 +152,7 @@ static int ptlrpcd(void *arg) unsigned long flags; ENTRY; - kportal_daemonize("ptlrpcd"); + kportal_daemonize(pc->pc_name); SIGNAL_MASK_LOCK(current, flags); sigfillset(¤t->blocked); @@ -206,7 +207,7 @@ int ptlrpcd_check_async_rpcs(void *arg) } #endif -static int ptlrpcd_start(struct ptlrpcd_ctl *pc) +static int ptlrpcd_start(char *name, struct ptlrpcd_ctl *pc) { int rc = 0; @@ -217,6 +218,7 @@ static int ptlrpcd_start(struct ptlrpcd_ctl *pc) pc->pc_flags = 0; spin_lock_init(&pc->pc_lock); INIT_LIST_HEAD(&pc->pc_req_list); + snprintf (pc->pc_name, sizeof (pc->pc_name), name); pc->pc_set = ptlrpc_prep_set(); if (pc->pc_set == NULL) @@ -258,13 +260,13 @@ int ptlrpcd_addref(void) if (++ptlrpcd_users != 1) GOTO(out, rc); - rc = ptlrpcd_start(&ptlrpcd_pc); + rc = ptlrpcd_start("ptlrpcd", &ptlrpcd_pc); if (rc) { --ptlrpcd_users; GOTO(out, rc); } - rc = ptlrpcd_start(&ptlrpcd_recovery_pc); + rc = ptlrpcd_start("ptlrpcd-recov", &ptlrpcd_recovery_pc); if (rc) { ptlrpcd_stop(&ptlrpcd_pc); --ptlrpcd_users; diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 9ad9b7d..171023f 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -91,7 +91,7 @@ ptlrpc_alloc_rqbd (struct ptlrpc_srv_ni *srv_ni) } void -ptlrpc_free_rqbd (struct ptlrpc_request_buffer_desc *rqbd) +ptlrpc_free_rqbd (struct ptlrpc_request_buffer_desc *rqbd) { struct ptlrpc_srv_ni *sni = rqbd->rqbd_srv_ni; struct ptlrpc_service *svc = sni->sni_service; @@ -136,7 +136,7 @@ ptlrpc_grow_req_bufs(struct ptlrpc_srv_ni *srv_ni) } void -ptlrpc_save_lock (struct ptlrpc_request *req, +ptlrpc_save_lock (struct ptlrpc_request *req, struct lustre_handle *lock, int mode) { struct ptlrpc_reply_state *rs = req->rq_reply_state; @@ -171,13 +171,13 @@ ptlrpc_schedule_difficult_reply (struct ptlrpc_reply_state *rs) wake_up (&svc->srv_waitq); } -void +void ptlrpc_commit_replies (struct obd_device *obd) { struct list_head *tmp; struct list_head *nxt; unsigned long flags; - + /* Find any replies that have been committed and get their service * to attend to complete them. */ @@ -186,7 +186,7 @@ ptlrpc_commit_replies (struct obd_device *obd) list_for_each_safe (tmp, nxt, &obd->obd_uncommitted_replies) { struct ptlrpc_reply_state *rs = - list_entry (tmp, struct ptlrpc_reply_state, rs_obd_list); + list_entry(tmp, struct ptlrpc_reply_state, rs_obd_list); LASSERT (rs->rs_difficult); @@ -199,7 +199,7 @@ ptlrpc_commit_replies (struct obd_device *obd) spin_unlock (&svc->srv_lock); } } - + spin_unlock_irqrestore (&obd->obd_uncommitted_replies_lock, flags); } @@ -283,7 +283,7 @@ ptlrpc_init_svc(int nbufs, int bufsize, int max_req_size, LASSERT (ptlrpc_ninterfaces > 0); LASSERT (nbufs > 0); LASSERT (bufsize >= max_req_size); - + ssize = offsetof (struct ptlrpc_service, srv_interfaces[ptlrpc_ninterfaces]); OBD_ALLOC(service, ssize); @@ -325,7 +325,7 @@ ptlrpc_init_svc(int nbufs, int bufsize, int max_req_size, spin_lock (&ptlrpc_all_services_lock); list_add (&service->srv_list, &ptlrpc_all_services); spin_unlock (&ptlrpc_all_services_lock); - + /* Now allocate the request buffers, assuming all interfaces require * the same number. */ for (i = 0; i < ptlrpc_ninterfaces; i++) { @@ -608,7 +608,7 @@ ptlrpc_server_handle_reply (struct ptlrpc_service *svc) spin_unlock_irqrestore (&svc->srv_lock, flags); RETURN(0); } - + rs = list_entry (svc->srv_reply_queue.next, struct ptlrpc_reply_state, rs_list); @@ -637,7 +637,7 @@ ptlrpc_server_handle_reply (struct ptlrpc_service *svc) been_handled = rs->rs_handled; rs->rs_handled = 1; - + nlocks = rs->rs_nlocks; /* atomic "steal", but */ rs->rs_nlocks = 0; /* locks still on rs_locks! */ @@ -655,7 +655,7 @@ ptlrpc_server_handle_reply (struct ptlrpc_service *svc) if ((!been_handled && rs->rs_on_net) || nlocks > 0) { spin_unlock_irqrestore(&svc->srv_lock, flags); - + if (!been_handled && rs->rs_on_net) { PtlMDUnlink(rs->rs_md_h); /* Ignore return code; we're racing with @@ -697,13 +697,13 @@ liblustre_check_services (void *arg) int rc; struct list_head *tmp, *nxt; ENTRY; - + /* I'm relying on being single threaded, not to have to lock * ptlrpc_all_services etc */ list_for_each_safe (tmp, nxt, &ptlrpc_all_services) { struct ptlrpc_service *svc = list_entry (tmp, struct ptlrpc_service, srv_list); - + if (svc->srv_nthreads != 0) /* I've recursed */ continue; @@ -711,16 +711,16 @@ liblustre_check_services (void *arg) * (arbitrarily) to recursing 1 stack frame per service. * Note that the problem with recursion is that we have to * unwind completely before our caller can resume. */ - + svc->srv_nthreads++; - + do { rc = ptlrpc_server_handle_reply(svc); rc |= ptlrpc_server_handle_request(svc); rc |= (ptlrpc_server_post_idle_rqbds(svc) > 0); did_something |= rc; } while (rc); - + svc->srv_nthreads--; } @@ -769,7 +769,7 @@ static int ptlrpc_retry_rqbds(void *arg) { struct ptlrpc_service *svc = (struct ptlrpc_service *)arg; - + svc->srv_rqbd_timeout = 0; return (-ETIMEDOUT); } @@ -955,7 +955,7 @@ int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc, if (thread == NULL) RETURN(-ENOMEM); init_waitqueue_head(&thread->t_ctl_waitq); - + d.dev = dev; d.svc = svc; d.name = name; @@ -1015,7 +1015,7 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service) * event with its 'unlink' flag set for each posted rqbd */ list_for_each(tmp, &srv_ni->sni_active_rqbds) { struct ptlrpc_request_buffer_desc *rqbd = - list_entry(tmp, struct ptlrpc_request_buffer_desc, + list_entry(tmp, struct ptlrpc_request_buffer_desc, rqbd_list); rc = PtlMDUnlink(rqbd->rqbd_md_h); @@ -1031,7 +1031,7 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service) if (rc == 0) break; - + /* Network access will complete in finite time but * the HUGE timeout lets us CWARN for visibility of * sluggish NALs */ @@ -1086,7 +1086,7 @@ int ptlrpc_unregister_service(struct ptlrpc_service *service) while (!list_empty(&service->srv_idle_rqbds)) { struct ptlrpc_request_buffer_desc *rqbd = list_entry(service->srv_idle_rqbds.next, - struct ptlrpc_request_buffer_desc, + struct ptlrpc_request_buffer_desc, rqbd_list); ptlrpc_free_rqbd(rqbd); diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index e3ebe1d..13911ba 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -1,5 +1,5 @@ # Lustre test Makefile -AM_CPPFLAGS = $(LLCPPFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 +AM_CPPFLAGS = $(LLCPPFLAGS) -I/opt/lam/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 AM_CFLAGS = $(LLCFLAGS) # LDADD = -lldap # LDADD := -lreadline -ltermcap # -lefence @@ -24,17 +24,17 @@ noinst_PROGRAMS += wantedi statone runas openfile getdents o_directory noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify cmknod noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify mkdirmany rmdirmany noinst_PROGRAMS += openfilleddirunlink rename_many memhog iopentest1 iopentest2 -noinst_PROGRAMS += mmap_sanity writemany +noinst_PROGRAMS += mmap_sanity flock_test writemany if MPITESTS -noinst_PROGRAMS += write_append_truncate createmany_mpi +noinst_PROGRAMS += parallel_grouplock write_append_truncate createmany_mpi endif # noinst_PROGRAMS += ldaptest copy_attr mkdirdeep bin_PROGRAMS = mcreate munlink endif # TESTS -mmap_sanity_SOURCES= mmap_sanity.c stat_SOURCES = stat.c stat_fs.h # mkdirdeep_LDADD=-L$(top_builddir)/portals/utils -lptlctl $(LIBREADLINE) +mmap_sanity_SOURCES= mmap_sanity.c if MPITESTS LAM_LD_FLAGS=-L/opt/lam/lib -lmpi -llam -lpthread @@ -42,6 +42,8 @@ write_append_truncate_SOURCES=write_append_truncate.c write_append_truncate_LDADD=$(LAM_LD_FLAGS) createmany_mpi_SOURCES=createmany-mpi.c createmany_mpi_LDADD=$(LAM_LD_FLAGS) +parallel_grouplock_SOURCES=parallel_grouplock.c lp_utils.c +parallel_grouplock_LDADD=$(LAM_LD_FLAGS) endif #copy_attr_LDADD= -lattr diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index f2fc5e2..ef777f9 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -9,6 +9,13 @@ set -e +ONLY=${ONLY:-"$*"} +# bug number for skipped test: +ALWAYS_EXCEPT=${ALWAYS_EXCEPT:-""} +# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! + +[ "$ALWAYS_EXCEPT$EXCEPT" ] && echo "Skipping tests: $ALWAYS_EXCEPT $EXCEPT" + SRCDIR=`dirname $0` PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH diff --git a/lustre/tests/flock_test.c b/lustre/tests/flock_test.c new file mode 100644 index 0000000..8ca0797 --- /dev/null +++ b/lustre/tests/flock_test.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void chd_lock_unlock(int); +char fname[1024]; + +int main(int argc, char **argv) +{ + pid_t pid; + int cfd, fd, rc; + + if (argc != 2) { + fprintf(stderr, "\nUSAGE: flock_test filepath\n"); + exit(2); + } + strncpy(fname, argv[1], 1023); + fname[1023] ='\0'; + fd = open(fname, O_RDWR|O_CREAT, (mode_t)0666); + if (fd == -1) { + fprintf(stderr, "flock_test: failed to open %s : ", fname); + perror(""); + exit(1); + } + if (flock(fd, LOCK_EX | LOCK_NB) == -1) { + fprintf(stderr, "flock_test: parent attempt to lock %s failed : ", \ + fname); + perror(""); + exit(1); + } + + pid = fork(); + if (pid == -1) { + fprintf(stderr, "flock_test: fork failed : "); + perror(""); + exit(1); + } + + if (pid == 0) { + pid = getpid(); + sleep(2); + if ((cfd = open(fname, O_RDWR)) == -1) { + fprintf(stderr, "flock_test child (%d) cannot open %s: ", \ + pid, fname); + perror(""); + exit(1); + } + if(flock(cfd, LOCK_EX | LOCK_NB) != -1) { + fprintf(stderr, "flock_test child (%d): %s not yet locked : ", \ + pid, fname); + exit(1); + } + if(flock(fd, LOCK_UN) == -1) { + fprintf(stderr, "flock_test child (%d): cannot unlock %s: ", \ + pid, fname); + perror(""); + exit(1); + } + if(flock(cfd, LOCK_EX | LOCK_NB) == -1 ) { + fprintf(stderr, \ + "flock_test: child (%d) cannot re-lock %s after unlocking : ", \ + pid, fname); + perror(""); + exit(1); + } + close(cfd); + exit(0); + } + + waitpid(pid, &rc, 0); + close(fd); + unlink(fname); + if (WIFEXITED(rc) && WEXITSTATUS(rc) != 0) { + fprintf(stderr, "flock_test: child (%d) exit code = %d\n", \ + pid, WEXITSTATUS(rc)); + exit(1); + } + exit(0); +} diff --git a/lustre/tests/local.sh b/lustre/tests/local.sh index b19837c..ab52aed 100755 --- a/lustre/tests/local.sh +++ b/lustre/tests/local.sh @@ -33,18 +33,27 @@ ${LMC} --add node --node localhost || exit 10 ${LMC} --add net --node localhost --nid `hostname` --nettype $NETTYPE || exit 11 ${LMC} --add net --node client --nid '*' --nettype $NETTYPE || exit 12 +[ "x$MDS_MOUNT_OPTS" != "x" ] && + MDS_MOUNT_OPTS="--mountfsoptions $MDS_MOUNT_OPTS" + # configure mds server ${LMC} --add mds --node localhost --mds mds1 --fstype $FSTYPE \ - --dev $MDSDEV --size $MDSSIZE $JARG $IARG $MDSOPT || exit 20 + --dev $MDSDEV \ + $MDS_MOUNT_OPTS --size $MDSSIZE $JARG $IARG $MDSOPT || exit 20 + +[ "x$OST_MOUNT_OPTS" != "x" ] && + OST_MOUNT_OPTS="--mountfsoptions $OST_MOUNT_OPTS" # configure ost ${LMC} -m $config --add lov --lov lov1 --mds mds1 --stripe_sz $STRIPE_BYTES \ --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 $LOVOPT || exit 20 -${LMC} --add ost --nspath /mnt/ost_ns --node localhost --lov lov1 \ - --fstype $FSTYPE --dev $OSTDEV --size $OSTSIZE $JARG $OSTOPT || exit 30 + +${LMC} --add ost --node localhost --lov lov1 --fstype $FSTYPE \ + --dev $OSTDEV \ + $OST_MOUNT_OPTS --size $OSTSIZE $JARG $OSTOPT || exit 30 # create client config -${LMC} --add mtpt --node localhost --path $MOUNT --mds mds1 --lov lov1 \ - $CLIENTOPT || exit 40 -${LMC} --add mtpt --node client --path $MOUNT2 --mds mds1 --lov lov1 \ - $CLIENTOPT || exit 41 +${LMC} --add mtpt --node localhost --path $MOUNT \ + --mds mds1 --lov lov1 $CLIENTOPT || exit 40 +${LMC} --add mtpt --node client --path $MOUNT2 \ + --mds mds1 --lov lov1 $CLIENTOPT || exit 41 diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index e0d4b3c..7fa6410 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -252,8 +252,8 @@ test_17() { sysctl -w lustre.fail_loc=0 do_facet client "df $DIR" # expect cmp to fail - do_facet client "cmp /etc/termcap $DIR/$tfile" && return 1 - do_facet client "rm $DIR/$tfile" || return 2 + do_facet client "cmp /etc/termcap $DIR/$tfile" && return 3 + do_facet client "rm $DIR/$tfile" || return 4 return 0 } run_test 17 "timeout bulk get, evict client (2732)" diff --git a/lustre/tests/routed.sh b/lustre/tests/routed.sh index c6d6bdb..dcd683c 100644 --- a/lustre/tests/routed.sh +++ b/lustre/tests/routed.sh @@ -79,7 +79,6 @@ for R in $ROUTERS; do --target_cluster_id $SERVER_CLUSTER done ---dev $OSTDEV --size $OSTSIZE # OSTNODE COUNT=1 for OSTNODE in $OSTNODES; do diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4045f28..45459b9 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2526,7 +2526,7 @@ test_71() { run_test 71 "Running dbench on lustre (don't segment fault) ====" test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly - check_kernel_version 43 || return 0 + check_kernel_version 43 || return 0 [ "$RUNAS_ID" = "$UID" ] && echo "skipping test 72" && return touch $DIR/f72 chmod 777 $DIR/f72 diff --git a/lustre/tests/sanityN.sh b/lustre/tests/sanityN.sh index dfe9187..f5f4d14 100644 --- a/lustre/tests/sanityN.sh +++ b/lustre/tests/sanityN.sh @@ -373,6 +373,7 @@ run_test 17 "resource creation/LVB creation race ===============" test_18() { ./mmap_sanity -d $MOUNT1 -m $MOUNT2 + sync; sleep 1; sync } run_test 18 "mmap sanity check =================================" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index f5e4509..39f08d8 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -529,7 +529,7 @@ build_test_filter() { eval ONLY_${O}=true done [ "$EXCEPT$ALWAYS_EXCEPT" ] && \ - log "skipping `echo $EXCEPT $ALWAYS_EXCEPT`" + log "skipping test `echo $EXCEPT $ALWAYS_EXCEPT`" for E in $EXCEPT $ALWAYS_EXCEPT; do eval EXCEPT_${E}=true done diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 20c1542..868835b 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -4,6 +4,7 @@ SUBDIRS = Lustre AM_CFLAGS=$(LLCFLAGS) AM_CPPFLAGS=$(LLCPPFLAGS) -DLUSTRE_UTILS=1 +AM_LDFLAGS := -L$(top_builddir)/portals/utils LIBPTLCTL := $(top_builddir)/portals/utils/libptlctl.a @@ -36,12 +37,10 @@ wirecheck_CPPFLAGS = -DCC="\"$(CC)\"" wiretest_SOURCES = wiretest.c lctl_SOURCES = parser.c obd.c lustre_cfg.c lctl.c parser.h obdctl.h - lload_SOURCES = lload.c obdio_SOURCES = obdio.c obdiolib.c obdiolib.h obdbarrier_SOURCES = obdbarrier.c obdiolib.c obdiolib.h lfs_SOURCES = lfs.c parser.c obd.c - llmount_SOURCES = llmount.c llmount_LDADD = $(LIBREADLINE) $(LIBPTLCTL) llmount_DEPENDENCIES := $(LIBPTLCTL) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 8dffe33..2570688 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -42,8 +42,6 @@ #include #ifdef HAVE_LINUX_TYPES_H #include -#else -#include "types.h" #endif #ifdef HAVE_LINUX_UNISTD_H #include @@ -56,7 +54,7 @@ #include #include #include -#include +#include #include static void err_msg(char *fmt, ...) @@ -421,7 +419,7 @@ int llapi_file_get_stripe(char *path, struct lov_user_md *lum) return errno; } - strncpy((char *)lum, fname, sizeof(*lum)); + strcpy((char *)lum, fname); if (ioctl(fd, IOC_MDC_GETSTRIPE, (void *)lum) == -1) { close(fd); free(dname); diff --git a/lustre/utils/llanalyze b/lustre/utils/llanalyze index 64c027d..c794c70 100644 --- a/lustre/utils/llanalyze +++ b/lustre/utils/llanalyze @@ -38,7 +38,7 @@ $subsys->{LOV} = 1 << 18; $subsys->{GMNAL} = 1 << 19; $subsys->{PTLROUTER} = 1 << 20; $subsys->{COBD} = 1 << 21; -$subsys->{IBNAL} = 1 << 22; +$subsys->{OPENIBNAL} = 1 << 22; $masks->{TRACE} = 1 << 0; # /* ENTRY/EXIT markers */ @@ -318,7 +318,7 @@ while () { $linesubsys == $subsys->{PORTALS} || $linesubsys == $subsys->{SOCKNAL} || $linesubsys == $subsys->{QSWNAL} || - $linesubsys == $subsys->{IBNAL} || + $linesubsys == $subsys->{OPENIBNAL} || $linesubsys == $subsys->{GMNAL})); if(!$entering_rpc) {entering_rpc($_);} if(!$leaving_rpc) {leaving_rpc($_);} diff --git a/lustre/utils/lmc b/lustre/utils/lmc index 11b9fb8..2ea28b4 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -85,7 +85,7 @@ Object creation command summary: --node node_name --mds mds_name --dev path - --fstype extN|ext3 + --fstype ldiskfs|ext3 --size size --nspath --journal_size size @@ -104,10 +104,11 @@ Object creation command summary: --add ost --node node_name --ost ost_name + --failover --lov lov_name --dev path --size size - --fstype extN|ext3 + --fstype ldiskfs|ext3 --journal_size size --inode_size size --osdtype obdecho|obdfilter @@ -209,8 +210,8 @@ lmc_options = [ ('stripe_pattern', "Specify the stripe pattern. RAID 0 is the only one currently supported.", PARAM, 0), # cobd - ('real_obd', "", PARAM), - ('cache_obd', "", PARAM), + ('real_obd', "Specify the real device for the cache obd system.", PARAM), + ('cache_obd', "Specify the cache device for the cache obd system.", PARAM), ('mgmt', "Specify management/monitoring service name.", PARAM, ""), ] @@ -371,15 +372,15 @@ class GenConfig: ldlm = self.newService("ldlm", name, uuid) return ldlm - def osd(self, name, uuid, fs, osdtype, devname, format, ost_uuid, + def osd(self, name, uuid, fstype, osdtype, devname, format, ost_uuid, node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath="", mkfsoptions="", mountfsoptions=""): osd = self.newService("osd", name, uuid) osd.setAttribute('osdtype', osdtype) osd.appendChild(self.ref("target", ost_uuid)) osd.appendChild(self.ref("node", node_uuid)) - if fs: - self.addElement(osd, "fstype", fs) + if fstype: + self.addElement(osd, "fstype", fstype) if devname: dev = self.addElement(osd, "devpath", devname) self.addElement(osd, "autoformat", format) @@ -391,7 +392,7 @@ class GenConfig: self.addElement(osd, "inodesize", "%s" % (inode_size)) if mkfsoptions: self.addElement(osd, "mkfsoptions", mkfsoptions) - if mountfsoptions: + if mountfsoptions: self.addElement(osd, "mountfsoptions", mountfsoptions) if nspath: self.addElement(osd, "nspath", nspath) @@ -434,11 +435,11 @@ class GenConfig: self.addElement(mds, "group", group) return mds - def mdsdev(self, name, uuid, fs, devname, format, node_uuid, + def mdsdev(self, name, uuid, fstype, devname, format, node_uuid, mds_uuid, dev_size=0, journal_size=0, inode_size=256, nspath="", mkfsoptions="", mountfsoptions=""): mdd = self.newService("mdsdev", name, uuid) - self.addElement(mdd, "fstype", fs) + self.addElement(mdd, "fstype", fstype) dev = self.addElement(mdd, "devpath", devname) self.addElement(mdd, "autoformat", format) if dev_size: @@ -451,7 +452,7 @@ class GenConfig: self.addElement(mdd, "nspath", nspath) if mkfsoptions: self.addElement(mdd, "mkfsoptions", mkfsoptions) - if mountfsoptions: + if mountfsoptions: self.addElement(mdd, "mountfsoptions", mountfsoptions) mdd.appendChild(self.ref("node", node_uuid)) @@ -469,7 +470,7 @@ class GenConfig: mtpt = self.newService("mountpoint", name, uuid) mtpt.appendChild(self.ref("filesystem", fs_uuid)) self.addElement(mtpt, "path", path) - if clientoptions: + if clientoptions: self.addElement(mtpt, "clientoptions", clientoptions) return mtpt @@ -648,7 +649,7 @@ def add_net(gen, lustre, options): if net_type in ('tcp','openib','ra'): port = get_option_int(options, 'port') - elif net_type in ('elan','gm','iib','vib','lo'): + elif net_type in ('elan','gm','iib','vib','lo','cray_kern_nal'): port = 0 else: print "Unknown net_type: ", net_type @@ -776,7 +777,7 @@ def add_ost(gen, lustre, options): journal_size = '' inode_size = '' mkfsoptions = '' - mountfsoptions = '' + mountfsoptions = '' else: devname = get_option(options, 'dev') # can be unset for bluearcs size = get_option(options, 'size') @@ -784,7 +785,7 @@ def add_ost(gen, lustre, options): journal_size = get_option(options, 'journal_size') inode_size = get_option(options, 'inode_size') mkfsoptions = get_option(options, 'mkfsoptions') - mountfsoptions = get_option(options, 'mountfsoptions') + mountfsoptions = get_option(options, 'mountfsoptions') nspath = get_option(options, 'nspath') diff --git a/lustre/utils/obdctl.c b/lustre/utils/obdctl.c index 28b1729..1c0b09b 100644 --- a/lustre/utils/obdctl.c +++ b/lustre/utils/obdctl.c @@ -70,6 +70,7 @@ command_t cmdlist[] = { {"setattr", jt_obd_setattr, 0, "setattr "}, {"newconn", jt_obd_newconn, 0, "newconn [newuuid]"}, {"test_getattr", jt_obd_test_getattr, 0, "test_getattr [verbose [[t]objid]]"}, + {"test_setattr", jt_obd_test_setattr, 0, "test_setattr [verbose [[t]objid]]"}, {"test_brw", jt_obd_test_brw, 0, "test_brw [t] [write [verbose [pages [[t]objid]]]]"}, {"dump_ldlm", jt_obd_dump_ldlm, 0, "dump all lock manager state (no args)"}, diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 70de0ad..0c5ca91 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -458,6 +458,7 @@ check_ldlm_extent(void) CHECK_STRUCT(ldlm_extent); CHECK_MEMBER(ldlm_extent, start); CHECK_MEMBER(ldlm_extent, end); + CHECK_MEMBER(ldlm_extent, gid); } void @@ -467,7 +468,6 @@ check_ldlm_flock(void) CHECK_STRUCT(ldlm_flock); CHECK_MEMBER(ldlm_flock, start); CHECK_MEMBER(ldlm_flock, end); - CHECK_MEMBER(ldlm_flock, blocking_export); CHECK_MEMBER(ldlm_flock, blocking_pid); CHECK_MEMBER(ldlm_flock, pid); }