diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 5cf43a6da43ec3939da2994c2ee3d9de3588e8a1..2e343b04c63141c750c577cd4deb48b7f7c5ffad 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -13,6 +13,15 @@ tbd Sun Microsystems, Inc. removed cwd "./" (refer to Bugzilla 14399). * File join has been disabled in this release, refer to Bugzilla 16929. +Severity : normal +Frequency : rare, need acl's on inode. +Bugzilla : 16492 +Description: client can't handle ost additional correctly +Details : if ost was added after client connected to mds client can have + hit lnet_try_match_md ... to big messages to wide striped files. + in this case need teach client to handle config events about add + lov target and update client max ea size at that event. + Severity : enhancement Bugzilla : 15699 Description: Changelogs diff --git a/lustre/include/lclient.h b/lustre/include/lclient.h index dfd7f65dbfff61eebc80b3cbcf17214a904d0d9d..2c88bebf3c0525345813f5cc513d95094d786d1b 100644 --- a/lustre/include/lclient.h +++ b/lustre/include/lclient.h @@ -371,5 +371,9 @@ int cl_local_size(struct inode *inode); ((void)sizeof(env), (void)sizeof(clob), (void)sizeof !!(expr)) #endif /* !INVARIANT_CHECK */ +int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp); +int cl_ocd_update(struct obd_device *host, + struct obd_device *watched, + enum obd_notify_event ev, void *owner); #endif /*LCLIENT_H */ diff --git a/lustre/include/lustre_lite.h b/lustre/include/lustre_lite.h index 34bb9f13d572a35342778f54ad05a97d022cf739..9fab984a6d68b444e5cde486e3d10e101114391f 100644 --- a/lustre/include/lustre_lite.h +++ b/lustre/include/lustre_lite.h @@ -126,45 +126,10 @@ struct lustre_client_ocd { */ __u64 lco_flags; spinlock_t lco_lock; + struct obd_export *lco_md_exp; + struct obd_export *lco_dt_exp; }; -/** - * This function is used as an upcall-callback hooked by liblustre and llite - * clients into obd_notify() listeners chain to handle notifications about - * change of import connect_flags. See llu_fsswop_mount() and - * lustre_common_fill_super(). - * - * Again, it is dumped into this header for the lack of a better place. - */ -static inline int ll_ocd_update(struct obd_device *host, - struct obd_device *watched, - enum obd_notify_event ev, void *owner) -{ - struct lustre_client_ocd *lco; - struct client_obd *cli; - __u64 flags; - int result; - - ENTRY; - if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) { - cli = &watched->u.cli; - lco = owner; - flags = cli->cl_import->imp_connect_data.ocd_connect_flags; - CDEBUG(D_SUPER, "Changing connect_flags: "LPX64" -> "LPX64"\n", - lco->lco_flags, flags); - spin_lock(&lco->lco_lock); - lco->lco_flags &= flags; - spin_unlock(&lco->lco_lock); - result = 0; - } else { - CERROR("unexpected notification from %s %s!\n", - watched->obd_type->typ_name, - watched->obd_name); - result = -EINVAL; - } - RETURN(result); -} - /* * Chain of hash overflow pages. */ diff --git a/lustre/liblustre/Makefile.am b/lustre/liblustre/Makefile.am index 326a8c043181e52e592579c37a65af5fbe760852..91e5f01df9055cc8ad826fa71b9c62ce995fd455 100644 --- a/lustre/liblustre/Makefile.am +++ b/lustre/liblustre/Makefile.am @@ -60,7 +60,7 @@ endif libllite_a_SOURCES = llite_lib.c llite_fid.c super.c namei.c rw.c file.c dir.c \ lutil.c lutil.h llite_lib.h llite_cl.c \ - ../lclient/lcommon_cl.c ../lclient/glimpse.c + ../lclient/lcommon_cl.c ../lclient/glimpse.c ../lclient/lcommon_misc.c # for make rpms -- need cleanup liblustre_a_SOURCES = llite_lib.c llite_fid.c super.c namei.c rw.c file.c dir.c \ diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index ff23356abe49c1d8328f51b6e9af41def68822f1..a410d2f4fc8d3902b4ac0b46322015768e5a65d4 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -1922,39 +1922,6 @@ struct inode *llu_iget(struct filesys *fs, struct lustre_md *md) return inode; } -static int -llu_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp) -{ - /* even if default lov is LOV_MAGIC_V1 we use LOV_MAGIC_V3 - * to be sure buffer are large enough */ - struct lov_stripe_md lsm = { .lsm_magic = LOV_MAGIC_V3 }; - __u32 valsize = sizeof(struct lov_desc); - int rc, easize, def_easize, cookiesize; - struct lov_desc desc; - __u32 stripes; - ENTRY; - - rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, - &valsize, &desc, NULL); - if (rc) - RETURN(rc); - - stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT); - lsm.lsm_stripe_count = stripes; - easize = obd_size_diskmd(dt_exp, &lsm); - - lsm.lsm_stripe_count = desc.ld_default_stripe_count; - def_easize = obd_size_diskmd(dt_exp, &lsm); - - cookiesize = stripes * sizeof(struct llog_cookie); - - CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n", - easize, cookiesize); - - rc = md_init_ea_size(md_exp, easize, def_easize, cookiesize); - RETURN(rc); -} - static int llu_fsswop_mount(const char *source, unsigned flags, @@ -2084,7 +2051,7 @@ llu_fsswop_mount(const char *source, sizeof(async), &async, NULL); obd->obd_upcall.onu_owner = &sbi->ll_lco; - obd->obd_upcall.onu_upcall = ll_ocd_update; + obd->obd_upcall.onu_upcall = cl_ocd_update; ocd.ocd_connect_flags = OBD_CONNECT_SRVLOCK | OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | OBD_CONNECT_TRUNCLOCK | @@ -2097,13 +2064,8 @@ llu_fsswop_mount(const char *source, } sbi->ll_dt_exp = class_conn2export(&dt_conn); sbi->ll_lco.lco_flags = ocd.ocd_connect_flags; - - if (err) { - CERROR("cannot register lock cancel callback: rc = %d\n", err); - GOTO(out_dt, err); - } - - llu_init_ea_size(sbi->ll_md_exp, sbi->ll_dt_exp); + sbi->ll_lco.lco_md_exp = sbi->ll_md_exp; + sbi->ll_lco.lco_dt_exp = sbi->ll_dt_exp; fid_zero(&sbi->ll_root_fid); err = md_getstatus(sbi->ll_md_exp, &sbi->ll_root_fid, NULL); @@ -2169,7 +2131,6 @@ out_inode: out_request: ptlrpc_req_finished(request); out_lock_cn_cb: -out_dt: obd_disconnect(sbi->ll_dt_exp); out_md: obd_disconnect(sbi->ll_md_exp); diff --git a/lustre/llite/Makefile.in b/lustre/llite/Makefile.in index b06f9014d83b8d0a585aab12fc5e8855dc14c9f0..848c26b010f48bf12329d91e3b80c33f2bbc0860 100644 --- a/lustre/llite/Makefile.in +++ b/lustre/llite/Makefile.in @@ -3,7 +3,7 @@ lustre-objs := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o lustre-objs += llite_fid.o rw.o lproc_llite.o namei.o symlink.o llite_mmap.o lustre-objs += xattr.o remote_perm.o llite_rmtacl.o llite_capa.o lustre-objs += rw26.o super25.o statahead.o -lustre-objs += ../lclient/glimpse.o ../lclient/lcommon_cl.o +lustre-objs += ../lclient/glimpse.o ../lclient/lcommon_cl.o ../lclient/lcommon_misc.o lustre-objs += vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o llite_lloop-objs := lloop.o diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 6b99d14167fffd6d2f66ef3ff2835d177b7a209e..7532fa8543a70a02c2013c0f6f7e3b4ea3151b1a 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -158,40 +158,6 @@ static struct dentry_operations ll_d_root_ops = { #endif }; -/* Initialize the default and maximum LOV EA and cookie sizes. This allows - * us to make MDS RPCs with large enough reply buffers to hold the - * maximum-sized (= maximum striped) EA and cookie without having to - * calculate this (via a call into the LOV + OSCs) each time we make an RPC. */ -static int ll_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp) -{ - struct lov_stripe_md lsm = { .lsm_magic = LOV_MAGIC_V3 }; - __u32 valsize = sizeof(struct lov_desc); - int rc, easize, def_easize, cookiesize; - struct lov_desc desc; - __u32 stripes; - ENTRY; - - rc = obd_get_info(dt_exp, sizeof(KEY_LOVDESC), KEY_LOVDESC, - &valsize, &desc, NULL); - if (rc) - RETURN(rc); - - stripes = min(desc.ld_tgt_count, (__u32)LOV_MAX_STRIPE_COUNT); - lsm.lsm_stripe_count = stripes; - easize = obd_size_diskmd(dt_exp, &lsm); - - lsm.lsm_stripe_count = desc.ld_default_stripe_count; - def_easize = obd_size_diskmd(dt_exp, &lsm); - - cookiesize = stripes * sizeof(struct llog_cookie); - - CDEBUG(D_HA, "updating max_mdsize/max_cookiesize: %d/%d\n", - easize, cookiesize); - - rc = md_init_ea_size(md_exp, easize, def_easize, cookiesize); - RETURN(rc); -} - static int client_common_fill_super(struct super_block *sb, char *md, char *dt) { struct inode *root = 0; @@ -403,7 +369,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) data->ocd_version, data->ocd_grant); obd->obd_upcall.onu_owner = &sbi->ll_lco; - obd->obd_upcall.onu_upcall = ll_ocd_update; + obd->obd_upcall.onu_upcall = cl_ocd_update; data->ocd_brw_size = PTLRPC_MAX_BRW_PAGES << CFS_PAGE_SHIFT; err = obd_connect(NULL, &dt_conn, obd, &sbi->ll_sb_uuid, data, NULL); @@ -429,14 +395,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) spin_lock(&sbi->ll_lco.lco_lock); sbi->ll_lco.lco_flags = data->ocd_connect_flags; + sbi->ll_lco.lco_md_exp = sbi->ll_md_exp; + sbi->ll_lco.lco_dt_exp = sbi->ll_dt_exp; spin_unlock(&sbi->ll_lco.lco_lock); - err = ll_init_ea_size(sbi->ll_md_exp, sbi->ll_dt_exp);; - if (err) { - CERROR("cannot set max EA and cookie sizes: rc = %d\n", err); - GOTO(out_lock_cn_cb, err); - } - fid_zero(&sbi->ll_root_fid); err = md_getstatus(sbi->ll_md_exp, &sbi->ll_root_fid, &oc); if (err) { diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index bf90727257b934348233ffd469b81463d9ee2b22..47b6cd7ea58f4a0808c7a695295a00903eaef372 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -531,25 +531,6 @@ static int mdc_finish_enqueue(struct obd_export *exp, if (eadata == NULL) RETURN(-EPROTO); - if (body->valid & OBD_MD_FLMODEASIZE) { - struct obd_device *obddev = class_exp2obd(exp); - - if (obddev->u.cli.cl_max_mds_easize < - body->max_mdsize) { - obddev->u.cli.cl_max_mds_easize = - body->max_mdsize; - CDEBUG(D_INFO, "maxeasize become %d\n", - body->max_mdsize); - } - if (obddev->u.cli.cl_max_mds_cookiesize < - body->max_cookiesize) { - obddev->u.cli.cl_max_mds_cookiesize = - body->max_cookiesize; - CDEBUG(D_INFO, "cookiesize become %d\n", - body->max_cookiesize); - } - } - /* * We save the reply LOV EA in case we have to replay a * create for recovery. If we didn't allocate a large diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 8d184b0484f48b2aca868578d855db4ea56dff3b..f23e8a48f3136a54543278d77eb2297827ba1047 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -180,15 +180,6 @@ static int mdc_getattr_common(struct obd_export *exp, RETURN(-EPROTO); } - if (body->valid & OBD_MD_FLMODEASIZE) { - struct client_obd *cli = &exp->exp_obd->u.cli; - - if (cli->cl_max_mds_easize < body->max_mdsize) - cli->cl_max_mds_easize = body->max_mdsize; - if (cli->cl_max_mds_cookiesize < body->max_cookiesize) - cli->cl_max_mds_cookiesize = body->max_cookiesize; - } - if (body->valid & OBD_MD_FLRMTPERM) { struct mdt_remote_perm *perm; diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 48b0f24306d3e03734d991790de7f4ecd36110e6..de84493ba51942ce829aec094c1607c5245d52c7 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -1490,6 +1490,48 @@ test_45() { #17310 } run_test 45 "long unlink handling in ptlrpcd" +test_46a() { + OSTCOUNT=6 + reformat + start_mds || return 1 + #first client should see only one ost + start_ost || return 2 + #start_client + mount_client $MOUNT || return 3 + + start_ost2 || return 4 + start ost3 `ostdevname 3` $OST_MOUNT_OPTS || return 5 + start ost4 `ostdevname 4` $OST_MOUNT_OPTS || return 6 + start ost5 `ostdevname 5` $OST_MOUNT_OPTS || return 7 + # wait until ost2-5 is sync + sleep 5 + #second client see both ost's + + mount_client $MOUNT2 || return 8 + $LFS setstripe $MOUNT2 -c -1 || return 9 + $LFS getstripe $MOUNT2 || return 10 + + echo "ok" > $MOUNT2/widestripe + $LFS getstripe $MOUNT2/widestripe || return 11 + # fill acl buffer for avoid expand lsm to them + awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do + setfacl -m $acl $MOUNT2/widestripe + done + + # will be deadlock + stat $MOUNT/widestripe || return 12 + + umount_client $MOUNT2 || return 13 + umount_client $MOUNT || return 14 + stop ost5 -f || return 20 + stop ost4 -f || return 21 + stop ost3 -f || return 22 + stop_ost2 || return 23 + stop_ost || return 24 + stop_mds || return 25 +} +run_test 46a "handle ost additional - wide striped file" + cleanup_gss equals_msg `basename $0`: test complete [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true