Whamcloud - gitweb
LU-16 Allow objects larger than 2TB in size
authorBobi Jam <bobijam@whamcloud.com>
Tue, 22 Mar 2011 04:41:17 +0000 (12:41 +0800)
committerOleg Drokin <green@whamcloud.com>
Sun, 24 Jul 2011 18:12:47 +0000 (14:12 -0400)
Use OST superblock sb->s_maxbytes telling LOV the maxmimum object size
it supports, and LOV records the minimum of the per-OSC maxbytes values
to determine the lov_stripe_md.lsm_maxbytes.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: Ice920dc59f5cc5855393bb7031fa089757b3314d
Bugzilla: 20128
Reviewed-on: http://review.whamcloud.com/241
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
17 files changed:
lustre/include/lustre/lustre_idl.h
lustre/llite/llite_lib.c
lustre/lov/lov_ea.c
lustre/lov/lov_internal.h
lustre/lov/lov_obd.c
lustre/lov/lov_pack.c
lustre/obdclass/lprocfs_status.c
lustre/obdfilter/filter.c
lustre/osc/osc_request.c
lustre/ptlrpc/import.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wirehdr.c
lustre/ptlrpc/wiretest.c
lustre/utils/wirecheck.c
lustre/utils/wirehdr.c
lustre/utils/wiretest.c

index 2e2f43b..b4f485b 100644 (file)
@@ -1101,6 +1101,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
 #define OBD_CONNECT_LAYOUTLOCK   0x2000000000ULL /* client supports layout lock */
 #define OBD_CONNECT_64BITHASH    0x4000000000ULL /* client supports 64-bits
                                                   * directory hash */
 #define OBD_CONNECT_LAYOUTLOCK   0x2000000000ULL /* client supports layout lock */
 #define OBD_CONNECT_64BITHASH    0x4000000000ULL /* client supports 64-bits
                                                   * directory hash */
+#define OBD_CONNECT_MAXBYTES     0x8000000000ULL /* max stripe size */
 /* also update obd_connect_names[] for lprocfs_rd_connect_flags()
  * and lustre/utils/wirecheck.c */
 
 /* also update obd_connect_names[] for lprocfs_rd_connect_flags()
  * and lustre/utils/wirecheck.c */
 
@@ -1134,7 +1135,7 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
                                 OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_VBR | \
                                 OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | \
                                 OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20 | \
                                 OBD_CONNECT_RMT_CLIENT_FORCE | OBD_CONNECT_VBR | \
                                 OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN | \
                                 OBD_CONNECT_GRANT_SHRINK | OBD_CONNECT_FULL20 | \
-                                OBD_CONNECT_64BITHASH)
+                                OBD_CONNECT_64BITHASH | OBD_CONNECT_MAXBYTES)
 #define ECHO_CONNECT_SUPPORTED (0)
 #define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
                                 OBD_CONNECT_FULL20)
 #define ECHO_CONNECT_SUPPORTED (0)
 #define MGS_CONNECT_SUPPORTED  (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
                                 OBD_CONNECT_FULL20)
@@ -1150,6 +1151,23 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
  *
  * If we eventually have separate connect data for different types, which we
  * almost certainly will, then perhaps we stick a union in here. */
  *
  * If we eventually have separate connect data for different types, which we
  * almost certainly will, then perhaps we stick a union in here. */
+struct obd_connect_data_v1 {
+        __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
+        __u32 ocd_version;       /* lustre release version number */
+        __u32 ocd_grant;         /* initial cache grant amount (bytes) */
+        __u32 ocd_index;         /* LOV index to connect to */
+        __u32 ocd_brw_size;      /* Maximum BRW size in bytes */
+        __u64 ocd_ibits_known;   /* inode bits this client understands */
+        __u32 ocd_nllu;          /* non-local-lustre-user */
+        __u32 ocd_nllg;          /* non-local-lustre-group */
+        __u64 ocd_transno;       /* first transno from client to be replayed */
+        __u32 ocd_group;         /* MDS group on OST */
+        __u32 ocd_cksum_types;   /* supported checksum algorithms */
+        __u32 ocd_max_easize;    /* How big LOV EA can be on MDS */
+        __u32 padding;           /* also fix lustre_swab_connect */
+        __u64 ocd_maxbytes;      /* Maximum stripe size in bytes */
+};
+
 struct obd_connect_data {
         __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
         __u32 ocd_version;       /* lustre release version number */
 struct obd_connect_data {
         __u64 ocd_connect_flags; /* OBD_CONNECT_* per above */
         __u32 ocd_version;       /* lustre release version number */
@@ -1162,10 +1180,31 @@ struct obd_connect_data {
         __u64 ocd_transno;       /* first transno from client to be replayed */
         __u32 ocd_group;         /* MDS group on OST */
         __u32 ocd_cksum_types;   /* supported checksum algorithms */
         __u64 ocd_transno;       /* first transno from client to be replayed */
         __u32 ocd_group;         /* MDS group on OST */
         __u32 ocd_cksum_types;   /* supported checksum algorithms */
-        __u64 padding1;          /* also fix lustre_swab_connect */
-        __u64 padding2;          /* also fix lustre_swab_connect */
+        __u32 ocd_max_easize;    /* How big LOV EA can be on MDS */
+        __u32 padding;           /* also fix lustre_swab_connect */
+        __u64 ocd_maxbytes;      /* Maximum stripe size in bytes */
+        /* Fields after ocd_maxbytes are only accessible by the receiver
+         * if the corresponding flag in ocd_connect_flags is set. Accessing
+         * any field after ocd_maxbytes on the receiver without a valid flag
+         * may result in out-of-bound memory access and kernel oops. */
+        __u64 padding1;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding2;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding3;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding4;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding5;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding6;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding7;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding8;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 padding9;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingA;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingB;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingC;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingD;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingE;          /* added 2.2.0. also fix lustre_swab_connect */
+        __u64 paddingF;          /* added 2.2.0. also fix lustre_swab_connect */
 };
 
 };
 
+
 extern void lustre_swab_connect(struct obd_connect_data *ocd);
 
 /*
 extern void lustre_swab_connect(struct obd_connect_data *ocd);
 
 /*
index 8489451..2aaffd4 100644 (file)
@@ -365,7 +365,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                                   OBD_CONNECT_SRVLOCK   | OBD_CONNECT_TRUNCLOCK|
                                   OBD_CONNECT_AT | OBD_CONNECT_RMT_CLIENT |
                                   OBD_CONNECT_OSS_CAPA | OBD_CONNECT_VBR|
                                   OBD_CONNECT_SRVLOCK   | OBD_CONNECT_TRUNCLOCK|
                                   OBD_CONNECT_AT | OBD_CONNECT_RMT_CLIENT |
                                   OBD_CONNECT_OSS_CAPA | OBD_CONNECT_VBR|
-                                  OBD_CONNECT_FULL20 | OBD_CONNECT_64BITHASH;
+                                  OBD_CONNECT_FULL20 | OBD_CONNECT_64BITHASH |
+                                  OBD_CONNECT_MAXBYTES;
 
         if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
                 data->ocd_connect_flags |= OBD_CONNECT_SOM;
 
         if (sbi->ll_flags & LL_SBI_SOM_PREVIEW)
                 data->ocd_connect_flags |= OBD_CONNECT_SOM;
@@ -450,7 +451,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 valid |= OBD_MD_FLACL;
 
         OBD_ALLOC_PTR(op_data);
                 valid |= OBD_MD_FLACL;
 
         OBD_ALLOC_PTR(op_data);
-        if (op_data == NULL) 
+        if (op_data == NULL)
                 GOTO(out_lock_cn_cb, err = -ENOMEM);
 
         op_data->op_fid1 = sbi->ll_root_fid;
                 GOTO(out_lock_cn_cb, err = -ENOMEM);
 
         op_data->op_fid1 = sbi->ll_root_fid;
index cb09efa..11e2b07 100755 (executable)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -200,10 +203,13 @@ int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm,
 {
         struct lov_oinfo *loi;
         int i;
 {
         struct lov_oinfo *loi;
         int i;
+        __u64 stripe_maxbytes = OBD_OBJECT_EOF;
 
         lsm_unpackmd_common(lsm, lmm);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++) {
 
         lsm_unpackmd_common(lsm, lmm);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++) {
+                struct obd_import *imp;
+
                 /* XXX LOV STACKING call down to osc_unpackmd() */
                 loi = lsm->lsm_oinfo[i];
                 loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
                 /* XXX LOV STACKING call down to osc_unpackmd() */
                 loi = lsm->lsm_oinfo[i];
                 loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
@@ -221,8 +227,26 @@ int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm,
                         lov_dump_lmm_v1(D_WARNING, lmm);
                         return -EINVAL;
                 }
                         lov_dump_lmm_v1(D_WARNING, lmm);
                         return -EINVAL;
                 }
+                /* calculate the minimum stripe max bytes */
+                imp = lov->lov_tgts[loi->loi_ost_idx]->ltd_obd->u.cli.cl_import;
+                if (imp != NULL) {
+                        if (!(imp->imp_connect_data.ocd_connect_flags &
+                              OBD_CONNECT_MAXBYTES)) {
+                                imp->imp_connect_data.ocd_maxbytes =
+                                                         LUSTRE_STRIPE_MAXBYTES;
+                        }
+                        if (stripe_maxbytes>imp->imp_connect_data.ocd_maxbytes){
+                                stripe_maxbytes =
+                                             imp->imp_connect_data.ocd_maxbytes;
+                        }
+                }
         }
 
         }
 
+        /* no ost connected yet */
+        if (stripe_maxbytes == OBD_OBJECT_EOF)
+                stripe_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+        lsm->lsm_maxbytes = stripe_maxbytes * lsm->lsm_stripe_count;
+
         return 0;
 }
 
         return 0;
 }
 
@@ -267,6 +291,7 @@ int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm,
         struct lov_mds_md_v3 *lmm;
         struct lov_oinfo *loi;
         int i;
         struct lov_mds_md_v3 *lmm;
         struct lov_oinfo *loi;
         int i;
+        __u64 stripe_maxbytes = OBD_OBJECT_EOF;
 
         lmm = (struct lov_mds_md_v3 *)lmmv1;
 
 
         lmm = (struct lov_mds_md_v3 *)lmmv1;
 
@@ -274,6 +299,8 @@ int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm,
         strncpy(lsm->lsm_pool_name, lmm->lmm_pool_name, LOV_MAXPOOLNAME);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++) {
         strncpy(lsm->lsm_pool_name, lmm->lmm_pool_name, LOV_MAXPOOLNAME);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++) {
+                struct obd_import *imp;
+
                 /* XXX LOV STACKING call down to osc_unpackmd() */
                 loi = lsm->lsm_oinfo[i];
                 loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
                 /* XXX LOV STACKING call down to osc_unpackmd() */
                 loi = lsm->lsm_oinfo[i];
                 loi->loi_id = le64_to_cpu(lmm->lmm_objects[i].l_object_id);
@@ -291,8 +318,26 @@ int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm,
                         lov_dump_lmm_v3(D_WARNING, lmm);
                         return -EINVAL;
                 }
                         lov_dump_lmm_v3(D_WARNING, lmm);
                         return -EINVAL;
                 }
+                /* calculate the minimum stripe max bytes */
+                imp = lov->lov_tgts[loi->loi_ost_idx]->ltd_obd->u.cli.cl_import;
+                if (imp != NULL) {
+                        if (!(imp->imp_connect_data.ocd_connect_flags &
+                              OBD_CONNECT_MAXBYTES)) {
+                                imp->imp_connect_data.ocd_maxbytes =
+                                                         LUSTRE_STRIPE_MAXBYTES;
+                        }
+                        if (stripe_maxbytes>imp->imp_connect_data.ocd_maxbytes){
+                                stripe_maxbytes =
+                                             imp->imp_connect_data.ocd_maxbytes;
+                        }
+                }
         }
 
         }
 
+        /* no ost connected yet */
+        if (stripe_maxbytes == OBD_OBJECT_EOF)
+                stripe_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+        lsm->lsm_maxbytes = stripe_maxbytes * lsm->lsm_stripe_count;
+
         return 0;
 }
 
         return 0;
 }
 
index cefcc3f..4aafdef 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -288,7 +291,7 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
 int lov_getstripe(struct obd_export *exp,
                   struct lov_stripe_md *lsm, struct lov_user_md *lump);
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
 int lov_getstripe(struct obd_export *exp,
                   struct lov_stripe_md *lsm, struct lov_user_md *lump);
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
-                      int pattern, int magic);
+                    int pattern, int magic);
 void lov_free_memmd(struct lov_stripe_md **lsmp);
 
 void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm);
 void lov_free_memmd(struct lov_stripe_md **lsmp);
 
 void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm);
index f2f9584..4108530 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -2742,7 +2745,6 @@ static int lov_set_info_async(struct obd_export *exp, obd_count keylen,
                         err = obd_set_info_async(tgt->ltd_exp, keylen, key,
                                                  sizeof(*info->capa),
                                                  info->capa, set);
                         err = obd_set_info_async(tgt->ltd_exp, keylen, key,
                                                  sizeof(*info->capa),
                                                  info->capa, set);
-                       
                 } else {
                         /* Only want a specific OSC */
                         if (check_uuid &&
                 } else {
                         /* Only want a specific OSC */
                         if (check_uuid &&
index 9e09afd..32cc2ad 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -289,7 +292,7 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count)
 }
 
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
 }
 
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
-                      int pattern, int magic)
+                    int pattern, int magic)
 {
         int i, lsm_size;
         ENTRY;
 {
         int i, lsm_size;
         ENTRY;
index 489ff03..4758cc5 100644 (file)
@@ -809,6 +809,7 @@ static const char *obd_connect_names[] = {
         "full20",
         "layout_lock",
         "64bithash",
         "full20",
         "layout_lock",
         "64bithash",
+        "object_max_bytes",
         NULL
 };
 
         NULL
 };
 
index 76e12fe..fb13c62 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -2782,6 +2785,9 @@ static int filter_connect_internal(struct obd_export *exp,
                                    obd_export_nid2str(exp));
         }
 
                                    obd_export_nid2str(exp));
         }
 
+        if (data->ocd_connect_flags & OBD_CONNECT_MAXBYTES)
+                data->ocd_maxbytes = exp->exp_obd->u.obt.obt_sb->s_maxbytes;
+
         RETURN(0);
 }
 
         RETURN(0);
 }
 
@@ -3538,7 +3544,7 @@ static int filter_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 LASSERT((*lsmp)->lsm_object_id);
         }
 
                 LASSERT((*lsmp)->lsm_object_id);
         }
 
-        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+        (*lsmp)->lsm_maxbytes = exp->exp_obd->u.obt.obt_sb->s_maxbytes;
 
         RETURN(lsm_size);
 }
 
         RETURN(lsm_size);
 }
index 577b8d6..44e51c1 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -109,6 +112,7 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
                         struct lov_mds_md *lmm, int lmm_bytes)
 {
         int lsm_size;
                         struct lov_mds_md *lmm, int lmm_bytes)
 {
         int lsm_size;
+        struct obd_import *imp = class_exp2cliimp(exp);
         ENTRY;
 
         if (lmm != NULL) {
         ENTRY;
 
         if (lmm != NULL) {
@@ -156,7 +160,11 @@ static int osc_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 LASSERT_SEQ_IS_MDT((*lsmp)->lsm_object_seq);
         }
 
                 LASSERT_SEQ_IS_MDT((*lsmp)->lsm_object_seq);
         }
 
-        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
+        if (imp != NULL &&
+            (imp->imp_connect_data.ocd_connect_flags & OBD_CONNECT_MAXBYTES))
+                (*lsmp)->lsm_maxbytes = imp->imp_connect_data.ocd_maxbytes;
+        else
+                (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
 
         RETURN(lsm_size);
 }
 
         RETURN(lsm_size);
 }
@@ -1117,7 +1125,7 @@ static void osc_init_grant(struct client_obd *cli, struct obd_connect_data *ocd)
                 CWARN("%s: available grant < 0, the OSS is probably not running"
                       " with patch from bug20278 (%ld) \n",
                       cli->cl_import->imp_obd->obd_name, cli->cl_avail_grant);
                 CWARN("%s: available grant < 0, the OSS is probably not running"
                       " with patch from bug20278 (%ld) \n",
                       cli->cl_import->imp_obd->obd_name, cli->cl_avail_grant);
-                /* workaround for 1.6 servers which do not have 
+                /* workaround for 1.6 servers which do not have
                  * the patch from bug20278 */
                 cli->cl_avail_grant = ocd->ocd_grant;
         }
                  * the patch from bug20278 */
                 cli->cl_avail_grant = ocd->ocd_grant;
         }
@@ -2437,7 +2445,7 @@ osc_send_oap_rpc(const struct lu_env *env, struct client_obd *cli,
          * to be canceled, the pages covered by the lock will be sent out
          * with ASYNC_HP. We have to send out them as soon as possible. */
         cfs_list_for_each_entry_safe(oap, tmp, &lop->lop_urgent, oap_urgent_item) {
          * to be canceled, the pages covered by the lock will be sent out
          * with ASYNC_HP. We have to send out them as soon as possible. */
         cfs_list_for_each_entry_safe(oap, tmp, &lop->lop_urgent, oap_urgent_item) {
-                if (oap->oap_async_flags & ASYNC_HP) 
+                if (oap->oap_async_flags & ASYNC_HP)
                         cfs_list_move(&oap->oap_pending_item, &tmp_list);
                 else
                         cfs_list_move_tail(&oap->oap_pending_item, &tmp_list);
                         cfs_list_move(&oap->oap_pending_item, &tmp_list);
                 else
                         cfs_list_move_tail(&oap->oap_pending_item, &tmp_list);
@@ -3607,8 +3615,8 @@ static int osc_statfs_interpret(const struct lu_env *env,
          *                   avail < ~0.1% max          max = avail + used
          *            1025 * avail < avail + used       used = blocks - free
          *            1024 * avail < used
          *                   avail < ~0.1% max          max = avail + used
          *            1025 * avail < avail + used       used = blocks - free
          *            1024 * avail < used
-         *            1024 * avail < blocks - free                      
-         *                   avail < ((blocks - free) >> 10)    
+         *            1024 * avail < blocks - free
+         *                   avail < ((blocks - free) >> 10)
          *
          * On very large disk, say 16TB 0.1% will be 16 GB. We don't want to
          * lose that amount of space so in those cases we report no space left
          *
          * On very large disk, say 16TB 0.1% will be 16 GB. We don't want to
          * lose that amount of space so in those cases we report no space left
index 80f169b..76de93e 100644 (file)
@@ -1281,7 +1281,7 @@ static int ptlrpc_invalidate_import_thread(void *data)
  * If we came to server that is in recovery, we enter IMP_REPLAY import state.
  * We go through our list of requests to replay and send them to server one by
  * one.
  * If we came to server that is in recovery, we enter IMP_REPLAY import state.
  * We go through our list of requests to replay and send them to server one by
  * one.
- * After sending all request from the list we change import state to 
+ * After sending all request from the list we change import state to
  * IMP_REPLAY_LOCKS and re-request all the locks we believe we have from server
  * and also all the locks we don't yet have and wait for server to grant us.
  * After that we send a special "replay completed" request and change import
  * IMP_REPLAY_LOCKS and re-request all the locks we believe we have from server
  * and also all the locks we don't yet have and wait for server to grant us.
  * After that we send a special "replay completed" request and change import
index edd4f19..2d7eeea 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -818,7 +821,19 @@ EXPORT_SYMBOL(RMF_CONN);
 struct req_msg_field RMF_CONNECT_DATA =
         DEFINE_MSGF("cdata",
                     RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
 struct req_msg_field RMF_CONNECT_DATA =
         DEFINE_MSGF("cdata",
                     RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
-                    sizeof(struct obd_connect_data), lustre_swab_connect, NULL);
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 0, 0)
+                    sizeof(struct obd_connect_data),
+#else
+/* For interoperability with 1.8 and 2.0 clients/servers.
+ * The RPC verification code allows larger RPC buffers, but not
+ * smaller buffers.  Until we no longer need to keep compatibility
+ * with older servers/clients we can only check that the buffer
+ * size is at least as large as obd_connect_data_v1.  That is not
+ * not in itself harmful, since the chance of just corrupting this
+ * field is low.  See JIRA LU-16 for details. */
+                    sizeof(struct obd_connect_data_v1),
+#endif
+                    lustre_swab_connect, NULL);
 EXPORT_SYMBOL(RMF_CONNECT_DATA);
 
 struct req_msg_field RMF_DLM_REQ =
 EXPORT_SYMBOL(RMF_CONNECT_DATA);
 
 struct req_msg_field RMF_DLM_REQ =
index 659882c..7b59b72 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -1570,8 +1573,30 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
         __swab64s(&ocd->ocd_transno);
         __swab32s(&ocd->ocd_group);
         __swab32s(&ocd->ocd_cksum_types);
         __swab64s(&ocd->ocd_transno);
         __swab32s(&ocd->ocd_group);
         __swab32s(&ocd->ocd_cksum_types);
+        /* Fields after ocd_cksum_types are only accessible by the receiver
+         * if the corresponding flag in ocd_connect_flags is set. Accessing
+         * any field after ocd_maxbytes on the receiver without a valid flag
+         * may result in out-of-bound memory access and kernel oops. */
+        if (ocd->ocd_connect_flags & OBD_CONNECT_MAX_EASIZE)
+                __swab32s(&ocd->ocd_max_easize);
+        CLASSERT(offsetof(typeof(*ocd), padding) != 0);
+        if (ocd->ocd_connect_flags & OBD_CONNECT_MAXBYTES)
+                __swab64s(&ocd->ocd_maxbytes);
         CLASSERT(offsetof(typeof(*ocd), padding1) != 0);
         CLASSERT(offsetof(typeof(*ocd), padding2) != 0);
         CLASSERT(offsetof(typeof(*ocd), padding1) != 0);
         CLASSERT(offsetof(typeof(*ocd), padding2) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding3) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding4) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding5) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding6) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding7) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding8) != 0);
+        CLASSERT(offsetof(typeof(*ocd), padding9) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingA) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingB) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingC) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingD) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingE) != 0);
+        CLASSERT(offsetof(typeof(*ocd), paddingF) != 0);
 }
 
 void lustre_swab_obdo (struct obdo  *o)
 }
 
 void lustre_swab_obdo (struct obdo  *o)
index 0c39cce..50acd02 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
index 452327c..a25f53a 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -410,7 +413,7 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
 
         /* Checks for struct obd_connect_data */
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
 
         /* Checks for struct obd_connect_data */
-        LASSERTF((int)sizeof(struct obd_connect_data) == 72, " found %lld\n",
+        LASSERTF((int)sizeof(struct obd_connect_data) == 192, " found %lld\n",
                  (long long)(int)sizeof(struct obd_connect_data));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_connect_flags) == 0, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags));
                  (long long)(int)sizeof(struct obd_connect_data));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_connect_flags) == 0, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags));
@@ -456,45 +459,66 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types));
                  (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 56, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_max_easize) == 56, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_max_easize));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize));
+        LASSERTF((int)offsetof(struct obd_connect_data, padding) == 60, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, padding));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->padding));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_maxbytes) == 64, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_maxbytes));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes));
+        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 72, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding1));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1));
                  (long long)(int)offsetof(struct obd_connect_data, padding1));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 64, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 80, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding2));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
                  (long long)(int)offsetof(struct obd_connect_data, padding2));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
-        CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
-        CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
-        CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
-        CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
-        CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
-        CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
-        CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
-        CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
-        CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
-        CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
-        CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
-        CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
-        CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
-        CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
-        CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
-        CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
-        CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
-        CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
-        CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
-        CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
-        CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
-        CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
-        CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
-        CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
-        CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
-        CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
-        CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
-        CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
-        CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
-        CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
-        CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_RDONLY ==                    0x1ULL);
+        CLASSERT(OBD_CONNECT_INDEX ==                     0x2ULL);
+        CLASSERT(OBD_CONNECT_MDS ==                       0x4ULL);
+        CLASSERT(OBD_CONNECT_GRANT ==                     0x8ULL);
+        CLASSERT(OBD_CONNECT_SRVLOCK ==                  0x10ULL);
+        CLASSERT(OBD_CONNECT_VERSION ==                  0x20ULL);
+        CLASSERT(OBD_CONNECT_REQPORTAL ==                0x40ULL);
+        CLASSERT(OBD_CONNECT_ACL ==                      0x80ULL);
+        CLASSERT(OBD_CONNECT_XATTR ==                   0x100ULL);
+        CLASSERT(OBD_CONNECT_CROW ==                    0x200ULL);
+        CLASSERT(OBD_CONNECT_TRUNCLOCK ==               0x400ULL);
+        CLASSERT(OBD_CONNECT_TRANSNO ==                 0x800ULL);
+        CLASSERT(OBD_CONNECT_IBITS ==                  0x1000ULL);
+        CLASSERT(OBD_CONNECT_JOIN ==                   0x2000ULL);
+        CLASSERT(OBD_CONNECT_ATTRFID ==                0x4000ULL);
+        CLASSERT(OBD_CONNECT_NODEVOH ==                0x8000ULL);
+        CLASSERT(OBD_CONNECT_RMT_CLIENT ==            0x10000ULL);
+        CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE ==      0x20000ULL);
+        CLASSERT(OBD_CONNECT_BRW_SIZE ==              0x40000ULL);
+        CLASSERT(OBD_CONNECT_QUOTA64 ==               0x80000ULL);
+        CLASSERT(OBD_CONNECT_MDS_CAPA ==             0x100000ULL);
+        CLASSERT(OBD_CONNECT_OSS_CAPA ==             0x200000ULL);
+        CLASSERT(OBD_CONNECT_CANCELSET ==            0x400000ULL);
+        CLASSERT(OBD_CONNECT_SOM ==                  0x800000ULL);
+        CLASSERT(OBD_CONNECT_AT ==                  0x1000000ULL);
+        CLASSERT(OBD_CONNECT_LRU_RESIZE ==          0x2000000ULL);
+        CLASSERT(OBD_CONNECT_MDS_MDS ==             0x4000000ULL);
+        CLASSERT(OBD_CONNECT_REAL ==                0x8000000ULL);
+        CLASSERT(OBD_CONNECT_CHANGE_QS ==          0x10000000ULL);
+        CLASSERT(OBD_CONNECT_CKSUM ==              0x20000000ULL);
+        CLASSERT(OBD_CONNECT_FID ==                0x40000000ULL);
+        CLASSERT(OBD_CONNECT_VBR ==                0x80000000ULL);
+        CLASSERT(OBD_CONNECT_LOV_V3 ==            0x100000000ULL);
+        CLASSERT(OBD_CONNECT_GRANT_SHRINK ==      0x200000000ULL);
+        CLASSERT(OBD_CONNECT_SKIP_ORPHAN ==       0x400000000ULL);
+        CLASSERT(OBD_CONNECT_MAX_EASIZE ==        0x800000000ULL);
+        CLASSERT(OBD_CONNECT_FULL20 ==           0x1000000000ULL);
+        CLASSERT(OBD_CONNECT_LAYOUTLOCK ==       0x2000000000ULL);
+        CLASSERT(OBD_CONNECT_64BITHASH ==        0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_MAXBYTES ==         0x8000000000ULL);
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
index 8bbd30b..93e1ea2 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -190,20 +193,24 @@ static void check_obd_connect_data(void)
         CHECK_MEMBER(obd_connect_data, ocd_transno);
         CHECK_MEMBER(obd_connect_data, ocd_group);
         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
         CHECK_MEMBER(obd_connect_data, ocd_transno);
         CHECK_MEMBER(obd_connect_data, ocd_group);
         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
+        CHECK_MEMBER(obd_connect_data, ocd_max_easize);
+        CHECK_MEMBER(obd_connect_data, padding);
+        CHECK_MEMBER(obd_connect_data, ocd_maxbytes);
         CHECK_MEMBER(obd_connect_data, padding1);
         CHECK_MEMBER(obd_connect_data, padding2);
 
         CHECK_CDEFINE(OBD_CONNECT_RDONLY);
         CHECK_CDEFINE(OBD_CONNECT_INDEX);
         CHECK_MEMBER(obd_connect_data, padding1);
         CHECK_MEMBER(obd_connect_data, padding2);
 
         CHECK_CDEFINE(OBD_CONNECT_RDONLY);
         CHECK_CDEFINE(OBD_CONNECT_INDEX);
+        CHECK_CDEFINE(OBD_CONNECT_MDS);
         CHECK_CDEFINE(OBD_CONNECT_GRANT);
         CHECK_CDEFINE(OBD_CONNECT_SRVLOCK);
         CHECK_CDEFINE(OBD_CONNECT_VERSION);
         CHECK_CDEFINE(OBD_CONNECT_REQPORTAL);
         CHECK_CDEFINE(OBD_CONNECT_ACL);
         CHECK_CDEFINE(OBD_CONNECT_XATTR);
         CHECK_CDEFINE(OBD_CONNECT_GRANT);
         CHECK_CDEFINE(OBD_CONNECT_SRVLOCK);
         CHECK_CDEFINE(OBD_CONNECT_VERSION);
         CHECK_CDEFINE(OBD_CONNECT_REQPORTAL);
         CHECK_CDEFINE(OBD_CONNECT_ACL);
         CHECK_CDEFINE(OBD_CONNECT_XATTR);
-        CHECK_CDEFINE(OBD_CONNECT_REAL);
-        CHECK_CDEFINE(OBD_CONNECT_CKSUM);
+        CHECK_CDEFINE(OBD_CONNECT_CROW);
         CHECK_CDEFINE(OBD_CONNECT_TRUNCLOCK);
         CHECK_CDEFINE(OBD_CONNECT_TRUNCLOCK);
+        CHECK_CDEFINE(OBD_CONNECT_TRANSNO);
         CHECK_CDEFINE(OBD_CONNECT_IBITS);
         CHECK_CDEFINE(OBD_CONNECT_JOIN);
         CHECK_CDEFINE(OBD_CONNECT_ATTRFID);
         CHECK_CDEFINE(OBD_CONNECT_IBITS);
         CHECK_CDEFINE(OBD_CONNECT_JOIN);
         CHECK_CDEFINE(OBD_CONNECT_ATTRFID);
@@ -214,16 +221,24 @@ static void check_obd_connect_data(void)
         CHECK_CDEFINE(OBD_CONNECT_QUOTA64);
         CHECK_CDEFINE(OBD_CONNECT_MDS_CAPA);
         CHECK_CDEFINE(OBD_CONNECT_OSS_CAPA);
         CHECK_CDEFINE(OBD_CONNECT_QUOTA64);
         CHECK_CDEFINE(OBD_CONNECT_MDS_CAPA);
         CHECK_CDEFINE(OBD_CONNECT_OSS_CAPA);
-        CHECK_CDEFINE(OBD_CONNECT_MDS_MDS);
+        CHECK_CDEFINE(OBD_CONNECT_CANCELSET);
         CHECK_CDEFINE(OBD_CONNECT_SOM);
         CHECK_CDEFINE(OBD_CONNECT_AT);
         CHECK_CDEFINE(OBD_CONNECT_SOM);
         CHECK_CDEFINE(OBD_CONNECT_AT);
-        CHECK_CDEFINE(OBD_CONNECT_CANCELSET);
         CHECK_CDEFINE(OBD_CONNECT_LRU_RESIZE);
         CHECK_CDEFINE(OBD_CONNECT_LRU_RESIZE);
+        CHECK_CDEFINE(OBD_CONNECT_MDS_MDS);
+        CHECK_CDEFINE(OBD_CONNECT_REAL);
+        CHECK_CDEFINE(OBD_CONNECT_CHANGE_QS);
+        CHECK_CDEFINE(OBD_CONNECT_CKSUM);
+        CHECK_CDEFINE(OBD_CONNECT_FID);
         CHECK_CDEFINE(OBD_CONNECT_VBR);
         CHECK_CDEFINE(OBD_CONNECT_VBR);
+        CHECK_CDEFINE(OBD_CONNECT_LOV_V3);
+        CHECK_CDEFINE(OBD_CONNECT_GRANT_SHRINK);
         CHECK_CDEFINE(OBD_CONNECT_SKIP_ORPHAN);
         CHECK_CDEFINE(OBD_CONNECT_SKIP_ORPHAN);
+        CHECK_CDEFINE(OBD_CONNECT_MAX_EASIZE);
         CHECK_CDEFINE(OBD_CONNECT_FULL20);
         CHECK_CDEFINE(OBD_CONNECT_LAYOUTLOCK);
         CHECK_CDEFINE(OBD_CONNECT_64BITHASH);
         CHECK_CDEFINE(OBD_CONNECT_FULL20);
         CHECK_CDEFINE(OBD_CONNECT_LAYOUTLOCK);
         CHECK_CDEFINE(OBD_CONNECT_64BITHASH);
+        CHECK_CDEFINE(OBD_CONNECT_MAXBYTES);
 }
 
 static void
 }
 
 static void
@@ -311,7 +326,7 @@ check_obdo(void)
         CHECK_CVALUE(OBD_FL_CKSUM_ADLER);
         CHECK_CVALUE(OBD_FL_SHRINK_GRANT);
         CHECK_CVALUE(OBD_FL_MMAP);
         CHECK_CVALUE(OBD_FL_CKSUM_ADLER);
         CHECK_CVALUE(OBD_FL_SHRINK_GRANT);
         CHECK_CVALUE(OBD_FL_MMAP);
-        CHECK_CDEFINE(OBD_FL_RECOV_RESEND);
+        CHECK_CVALUE(OBD_FL_RECOV_RESEND);
         CHECK_CVALUE(OBD_CKSUM_CRC32);
         CHECK_CVALUE(OBD_CKSUM_ADLER);
 }
         CHECK_CVALUE(OBD_CKSUM_CRC32);
         CHECK_CVALUE(OBD_CKSUM_ADLER);
 }
@@ -691,7 +706,7 @@ check_mdt_rec_rename(void)
         CHECK_MEMBER(mdt_rec_rename, rn_padding_1);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_2);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_3);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_1);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_2);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_3);
-        CHECK_MEMBER(mdt_rec_rename, rn_padding_4); 
+        CHECK_MEMBER(mdt_rec_rename, rn_padding_4);
         CHECK_MEMBER(mdt_rec_rename, rn_bias);
         CHECK_MEMBER(mdt_rec_rename, rn_mode);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_5);
         CHECK_MEMBER(mdt_rec_rename, rn_bias);
         CHECK_MEMBER(mdt_rec_rename, rn_mode);
         CHECK_MEMBER(mdt_rec_rename, rn_padding_5);
index 120b887..354c21f 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
index 6b74c32..8cd3ae5 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -407,7 +410,7 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
 
         /* Checks for struct obd_connect_data */
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions[4]));
 
         /* Checks for struct obd_connect_data */
-        LASSERTF((int)sizeof(struct obd_connect_data) == 72, " found %lld\n",
+        LASSERTF((int)sizeof(struct obd_connect_data) == 192, " found %lld\n",
                  (long long)(int)sizeof(struct obd_connect_data));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_connect_flags) == 0, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags));
                  (long long)(int)sizeof(struct obd_connect_data));
         LASSERTF((int)offsetof(struct obd_connect_data, ocd_connect_flags) == 0, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, ocd_connect_flags));
@@ -453,45 +456,66 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types));
                  (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 56, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_max_easize) == 56, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_max_easize));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize));
+        LASSERTF((int)offsetof(struct obd_connect_data, padding) == 60, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, padding));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->padding));
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_maxbytes) == 64, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_maxbytes));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_maxbytes));
+        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 72, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding1));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1));
                  (long long)(int)offsetof(struct obd_connect_data, padding1));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 64, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 80, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding2));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
                  (long long)(int)offsetof(struct obd_connect_data, padding2));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
-        CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
-        CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
-        CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
-        CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
-        CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
-        CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
-        CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
-        CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
-        CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
-        CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
-        CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
-        CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
-        CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
-        CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
-        CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
-        CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
-        CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
-        CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
-        CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
-        CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
-        CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
-        CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
-        CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
-        CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
-        CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
-        CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
-        CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
-        CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
-        CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
-        CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
-        CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_RDONLY ==                    0x1ULL);
+        CLASSERT(OBD_CONNECT_INDEX ==                     0x2ULL);
+        CLASSERT(OBD_CONNECT_MDS ==                       0x4ULL);
+        CLASSERT(OBD_CONNECT_GRANT ==                     0x8ULL);
+        CLASSERT(OBD_CONNECT_SRVLOCK ==                  0x10ULL);
+        CLASSERT(OBD_CONNECT_VERSION ==                  0x20ULL);
+        CLASSERT(OBD_CONNECT_REQPORTAL ==                0x40ULL);
+        CLASSERT(OBD_CONNECT_ACL ==                      0x80ULL);
+        CLASSERT(OBD_CONNECT_XATTR ==                   0x100ULL);
+        CLASSERT(OBD_CONNECT_CROW ==                    0x200ULL);
+        CLASSERT(OBD_CONNECT_TRUNCLOCK ==               0x400ULL);
+        CLASSERT(OBD_CONNECT_TRANSNO ==                 0x800ULL);
+        CLASSERT(OBD_CONNECT_IBITS ==                  0x1000ULL);
+        CLASSERT(OBD_CONNECT_JOIN ==                   0x2000ULL);
+        CLASSERT(OBD_CONNECT_ATTRFID ==                0x4000ULL);
+        CLASSERT(OBD_CONNECT_NODEVOH ==                0x8000ULL);
+        CLASSERT(OBD_CONNECT_RMT_CLIENT ==            0x10000ULL);
+        CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE ==      0x20000ULL);
+        CLASSERT(OBD_CONNECT_BRW_SIZE ==              0x40000ULL);
+        CLASSERT(OBD_CONNECT_QUOTA64 ==               0x80000ULL);
+        CLASSERT(OBD_CONNECT_MDS_CAPA ==             0x100000ULL);
+        CLASSERT(OBD_CONNECT_OSS_CAPA ==             0x200000ULL);
+        CLASSERT(OBD_CONNECT_CANCELSET ==            0x400000ULL);
+        CLASSERT(OBD_CONNECT_SOM ==                  0x800000ULL);
+        CLASSERT(OBD_CONNECT_AT ==                  0x1000000ULL);
+        CLASSERT(OBD_CONNECT_LRU_RESIZE ==          0x2000000ULL);
+        CLASSERT(OBD_CONNECT_MDS_MDS ==             0x4000000ULL);
+        CLASSERT(OBD_CONNECT_REAL ==                0x8000000ULL);
+        CLASSERT(OBD_CONNECT_CHANGE_QS ==          0x10000000ULL);
+        CLASSERT(OBD_CONNECT_CKSUM ==              0x20000000ULL);
+        CLASSERT(OBD_CONNECT_FID ==                0x40000000ULL);
+        CLASSERT(OBD_CONNECT_VBR ==                0x80000000ULL);
+        CLASSERT(OBD_CONNECT_LOV_V3 ==            0x100000000ULL);
+        CLASSERT(OBD_CONNECT_GRANT_SHRINK ==      0x200000000ULL);
+        CLASSERT(OBD_CONNECT_SKIP_ORPHAN ==       0x400000000ULL);
+        CLASSERT(OBD_CONNECT_MAX_EASIZE ==        0x800000000ULL);
+        CLASSERT(OBD_CONNECT_FULL20 ==           0x1000000000ULL);
+        CLASSERT(OBD_CONNECT_LAYOUTLOCK ==       0x2000000000ULL);
+        CLASSERT(OBD_CONNECT_64BITHASH ==        0x4000000000ULL);
+        CLASSERT(OBD_CONNECT_MAXBYTES ==         0x8000000000ULL);
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",