Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Fri, 3 Mar 2006 00:28:12 +0000 (00:28 +0000)
committernathan <nathan>
Fri, 3 Mar 2006 00:28:12 +0000 (00:28 +0000)
b=4482
if there are no osc's, we don't know how big to make the page size

lustre/llite/llite_lib.c
lustre/lov/lov_obd.c

index 90a3604..3f0067b 100644 (file)
@@ -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);
index d9947d0..f3a683c 100644 (file)
@@ -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);