From: Mikhal Pershin Date: Fri, 10 Nov 2017 10:18:48 +0000 (+0300) Subject: LU-3285 merge: 'dom' branch merging X-Git-Tag: 2.10.56~64 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3cbe63e72c83ba50c3553d28e2fe6bc9d18c347a LU-3285 merge: 'dom' branch merging Merge remote-tracking branch 'origin/dom' Signed-off-by: Mikhal Pershin Change-Id: I8c20ac4f5fdae6ec7ad034fbb7f5fda656f03c8b --- 3cbe63e72c83ba50c3553d28e2fe6bc9d18c347a diff --cc lustre/doc/lfs-setstripe.1 index 583cf31,332f1b6..8d911352 --- a/lustre/doc/lfs-setstripe.1 +++ b/lustre/doc/lfs-setstripe.1 @@@ -133,12 -115,33 +133,33 @@@ will be used as well; th .I start_ost_index must be part of the pool or an error will be returned. .TP + .B -L, --layout <\fIlayout type\fB>\fR + The type of stripe layout, can be + .BR raid0 ", " released " or " mdt ". + It is + .BR raid0 + by default. The + .BR mdt + type allows place the first component of the file on the MDT where the inode + is located. This is used with composite file layouts and can be defined as + first component only. The + .IR stripe_size + of MDT part is always equal to the component size. There is also per-MDT + parameter + .IR lod.dom_stripesize + to limit maximum size of DoM stripe which can be changed with + .BR lctl\ set_param + command, (e.g. + .IR lctl\ set_param\ lod.*.dom_stripesize=0 + , see + .BR lctl (8)) + .TP There are two options available only for \fBlfs migrate\fR: .TP -.B -b, --block +.BR -b , --block Block file access during data migration (default). .TP -.B -n, --non-block +.BR -n , --non-block Abort migrations if concurrent access is detected. .SH COMPONENT_OPTIONS The various component related options are listed and explained below: diff --cc lustre/mdt/mdt_handler.c index 9f8590b,20a64a2..5ef06db --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@@ -4816,56 -5010,56 +5010,57 @@@ static void mdt_fini(const struct lu_en static int mdt_postrecov(const struct lu_env *, struct mdt_device *); static int mdt_init0(const struct lu_env *env, struct mdt_device *m, - struct lu_device_type *ldt, struct lustre_cfg *cfg) + struct lu_device_type *ldt, struct lustre_cfg *cfg) { - struct mdt_thread_info *info; - struct obd_device *obd; + const struct dt_device_param *dt_conf; + struct mdt_thread_info *info; + struct obd_device *obd; + const char *dev = lustre_cfg_string(cfg, 0); + const char *num = lustre_cfg_string(cfg, 2); + struct tg_grants_data *tgd = &m->mdt_lut.lut_tgd; - const char *dev = lustre_cfg_string(cfg, 0); - const char *num = lustre_cfg_string(cfg, 2); - struct lustre_mount_info *lmi = NULL; - struct lustre_sb_info *lsi; - struct lu_site *s; - struct seq_server_site *ss_site; - const char *identity_upcall = "NONE"; - struct md_device *next; - int rc; - long node_id; - mntopt_t mntopts; - ENTRY; + struct lustre_mount_info *lmi = NULL; + struct lustre_sb_info *lsi; + struct lu_site *s; + struct seq_server_site *ss_site; + const char *identity_upcall = "NONE"; + struct md_device *next; + int rc; + long node_id; + mntopt_t mntopts; + ENTRY; lu_device_init(&m->mdt_lu_dev, ldt); - /* - * Environment (env) might be missing mdt_thread_key values at that - * point, if device is allocated when mdt_thread_key is in QUIESCENT - * mode. - * - * Usually device allocation path doesn't use module key values, but - * mdt has to do a lot of work here, so allocate key value. - */ - rc = lu_env_refill((struct lu_env *)env); - if (rc != 0) - RETURN(rc); + /* + * Environment (env) might be missing mdt_thread_key values at that + * point, if device is allocated when mdt_thread_key is in QUIESCENT + * mode. + * + * Usually device allocation path doesn't use module key values, but + * mdt has to do a lot of work here, so allocate key value. + */ + rc = lu_env_refill((struct lu_env *)env); + if (rc != 0) + RETURN(rc); - info = lu_context_key_get(&env->le_ctx, &mdt_thread_key); - LASSERT(info != NULL); + info = lu_context_key_get(&env->le_ctx, &mdt_thread_key); + LASSERT(info != NULL); - obd = class_name2obd(dev); - LASSERT(obd != NULL); + obd = class_name2obd(dev); + LASSERT(obd != NULL); - m->mdt_max_mdsize = MAX_MD_SIZE; /* 4 stripes */ + m->mdt_max_mdsize = MAX_MD_SIZE; /* 4 stripes */ m->mdt_opts.mo_evict_tgt_nids = 1; - m->mdt_opts.mo_cos = MDT_COS_DEFAULT; + m->mdt_opts.mo_cos = MDT_COS_DEFAULT; lmi = server_get_mount(dev); - if (lmi == NULL) { - CERROR("Cannot get mount info for %s!\n", dev); - RETURN(-EFAULT); - } else { - lsi = s2lsi(lmi->lmi_sb); - /* CMD is supported only in IAM mode */ - LASSERT(num); - node_id = simple_strtol(num, NULL, 10); + if (lmi == NULL) { + CERROR("Cannot get mount info for %s!\n", dev); + RETURN(-EFAULT); + } else { + lsi = s2lsi(lmi->lmi_sb); + /* CMD is supported only in IAM mode */ + LASSERT(num); + node_id = simple_strtol(num, NULL, 10); obd->u.obt.obt_magic = OBT_MAGIC; if (lsi->lsi_lmd != NULL && lsi->lsi_lmd->lmd_flags & LMD_FLG_SKIP_LFSCK) diff --cc lustre/mdt/mdt_mds.c index 2b12f84,078051a..b9c806f --- a/lustre/mdt/mdt_mds.c +++ b/lustre/mdt/mdt_mds.c @@@ -64,7 -64,9 +64,8 @@@ struct mds_device struct ptlrpc_service *mds_mdsc_service; struct ptlrpc_service *mds_mdss_service; struct ptlrpc_service *mds_fld_service; + struct ptlrpc_service *mds_io_service; struct mutex mds_health_mutex; - struct kset *mds_kset; }; /* @@@ -439,6 -449,43 +448,43 @@@ static int mds_start_ptlrpc_service(str GOTO(err_mds_svc, rc); } + memset(&conf, 0, sizeof(conf)); + conf = (typeof(conf)) { + .psc_name = LUSTRE_MDT_NAME "_io", + .psc_watchdog_factor = MDT_SERVICE_WATCHDOG_FACTOR, + .psc_buf = { + .bc_nbufs = OST_NBUFS, + .bc_buf_size = OST_IO_BUFSIZE, + .bc_req_max_size = OST_IO_MAXREQSIZE, + .bc_rep_max_size = OST_IO_MAXREPSIZE, + .bc_req_portal = MDS_IO_PORTAL, + .bc_rep_portal = MDC_REPLY_PORTAL, + }, + .psc_thr = { + .tc_thr_name = "ll_mdt_io", + .tc_thr_factor = OSS_THR_FACTOR, + .tc_nthrs_init = OSS_NTHRS_INIT, + .tc_nthrs_base = OSS_NTHRS_BASE, + .tc_nthrs_max = mds_max_io_threads, + .tc_cpu_affinity = 1, + .tc_ctx_tags = LCT_DT_THREAD | LCT_MD_THREAD, + }, + .psc_ops = { + .so_thr_init = tgt_io_thread_init, + .so_thr_done = tgt_io_thread_done, + .so_req_handler = tgt_request_handle, + .so_req_printer = target_print_req, + }, + }; - m->mds_io_service = ptlrpc_register_service(&conf, m->mds_kset, ++ m->mds_io_service = ptlrpc_register_service(&conf, &obd->obd_kset, + procfs_entry); + if (IS_ERR(m->mds_io_service)) { + rc = PTR_ERR(m->mds_io_service); + CERROR("failed to start MDT I/O service: %d\n", rc); + m->mds_io_service = NULL; + GOTO(err_mds_svc, rc); + } + EXIT; err_mds_svc: if (rc) diff --cc lustre/utils/lfs.c index be6a2d3,515f169..026e36e --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@@ -113,20 -113,22 +113,22 @@@ static int lfs_list_commands(int argc, /* Setstripe and migrate share mostly the same parameters */ #define SSM_CMD_COMMON(cmd) \ - "usage: "cmd" [--stripe-count|-c ]\n" \ + "usage: "cmd" [--component-end|-E ]\n" \ + " [--stripe-count|-c ]\n" \ " [--stripe-index|-i ]\n" \ " [--stripe-size|-S ]\n" \ + " [--layout|-L ]\n" \ " [--pool|-p ]\n" \ - " [--ost|-o ]\n" \ - " [--component-end|-E ]\n" + " [--ost|-o ]\n" #define SSM_HELP_COMMON \ - "\tstripe_size: Number of bytes on each OST (0 filesystem default)\n" \ - "\t Can be specified with k, m or g (in KB, MB and GB\n" \ + "\tstripe_count: Number of OSTs to stripe over (0=fs default, -1 all)\n" \ + "\tstart_ost_idx: OST index of first stripe (-1=default round robin)\n"\ + "\tstripe_size: Number of bytes on each OST (0=fs default)\n" \ + "\t Can be specified with K, M or G (for KB, MB, GB\n" \ "\t respectively)\n" \ - "\tstart_ost_idx: OST index of first stripe (-1 default)\n" \ - "\tstripe_count: Number of OSTs to stripe over (0 default, -1 all)\n" \ "\tpool_name: Name of OST pool to use (default none)\n" \ + "\tlayout: stripe pattern type: raid0, mdt (default raid0)\n"\ "\tost_indices: List of OST indices, can be repeated multiple times\n"\ "\t Indices be specified in a format of:\n" \ "\t -o ,-,\n" \ @@@ -1469,18 -1545,40 +1518,42 @@@ static int lfs_setstripe(int argc, cha comp_id = strtoul(optarg, &end, 0); if (*end != '\0' || comp_id == 0 || comp_id > LCME_ID_MAX) { - fprintf(stderr, "error: %s: bad comp ID " - "'%s'\n", argv[0], optarg); - goto error; + fprintf(stderr, + "%s %s: invalid component ID '%s'\n", + progname, argv[0], optarg); + goto usage_error; } break; + case 'L': + if (strcmp(argv[optind - 1], "mdt") == 0) { + /* Can be only the first component */ + if (layout != NULL) { + result = -EINVAL; + fprintf(stderr, "error: 'mdt' layout " + "can be only the first one\n"); + goto error; + } + if (lsa.lsa_comp_end > (1ULL << 30)) { /* 1Gb */ + result = -EFBIG; + fprintf(stderr, "error: 'mdt' layout " + "size is too big\n"); + goto error; + } + lsa.lsa_pattern = LLAPI_LAYOUT_MDT; + } else if (strcmp(argv[optind - 1], "raid0") != 0) { + result = -EINVAL; + fprintf(stderr, "error: layout '%s' is " + "unknown, supported layouts are: " + "'mdt', 'raid0'\n", argv[optind]); + goto error; + } + break; case 'm': if (!migrate_mode) { - fprintf(stderr, "--mdt-index is valid only for" - " migrate mode\n"); - goto error; + fprintf(stderr, + "%s %s: -m|--mdt-index valid only for migrate command\n", + progname, argv[0]); + goto usage_error; } mdt_idx_arg = optarg; break;