From: nathan Date: Fri, 3 Mar 2006 00:28:12 +0000 (+0000) Subject: Branch b1_4_mountconf X-Git-Tag: v1_8_0_110~486^4~11 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=51df5079032010d2cc5fe6012732f687c59a1f81;p=fs%2Flustre-release.git Branch b1_4_mountconf b=4482 if there are no osc's, we don't know how big to make the page size --- diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 90a3604..3f0067b 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -242,11 +242,18 @@ int client_common_fill_super(struct super_block *sb, char *mdc, char *osc) mdc_init_ea_size(sbi->ll_mdc_exp, sbi->ll_osc_exp); + err = obd_prep_async_page(sbi->ll_osc_exp, NULL, NULL, NULL, + 0, NULL, NULL, NULL); + if (err < 0) { + LCONSOLE_ERROR("There are no OST's in this filesystem. " + "There must be at least one active OST for " + "a client to start.\n"); + GOTO(out_osc, err); + } + if (!ll_async_page_slab) { ll_async_page_slab_size = - size_round(sizeof(struct ll_async_page)) + - obd_prep_async_page(sbi->ll_osc_exp, NULL, NULL, NULL, - 0, NULL, NULL, NULL); + size_round(sizeof(struct ll_async_page)) + err; ll_async_page_slab = kmem_cache_create("ll_async_page", ll_async_page_slab_size, 0, 0, NULL, NULL); diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index d9947d0..f3a683c 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -1526,11 +1526,19 @@ int lov_prep_async_page(struct obd_export *exp, struct lov_stripe_md *lsm, ENTRY; if (!page) { - while (!lov->tgts[rc].ltd_exp) - rc++; - return size_round(sizeof(*lap)) + - obd_prep_async_page(lov->tgts[rc].ltd_exp, NULL, NULL, - NULL, 0, NULL, NULL, NULL); + int i = 0; + /* Find an existing osc so we can get it's stupid sizeof(*oap). + Only because of this layering limitation will a client + mount with no osts fail */ + while (!lov->tgts[i].ltd_exp) { + i++; + if (i >= lov->desc.ld_tgt_count) + RETURN(-ENOTBLK); + } + rc = size_round(sizeof(*lap)) + + obd_prep_async_page(lov->tgts[i].ltd_exp, NULL, NULL, + NULL, 0, NULL, NULL, NULL); + RETURN(rc); } ASSERT_LSM_MAGIC(lsm); LASSERT(loi == NULL);