#define OBD_COMPAT_OST 0x00000002
/** COMPAT_146: this is an MDT (temporary) */
#define OBD_COMPAT_MDT 0x00000004
+/** 2.0 server, interop flag to show server version is changed */
+#define OBD_COMPAT_20 0x00000008
/** MDS handles LOV_OBJID file */
#define OBD_ROCOMPAT_LOVOBJID 0x00000001
#define OBD_INCOMPAT_COMMON_LR 0x00000008
/** FID is enabled */
#define OBD_INCOMPAT_FID 0x00000010
-/** lustre disk using iam format to store directory entries */
-#define OBD_INCOMPAT_IAM_DIR 0x00000020
-/** 2.0 server, interop flag to show server is changed */
-#define OBD_INCOMPAT_20 0x00000040
+/** Size-on-MDS is enabled */
+#define OBD_INCOMPAT_SOM 0x00000020
+/** filesystem using iam format to store directory entries */
+#define OBD_INCOMPAT_IAM_DIR 0x00000040
+/** LMA attribute contains per-inode incompatible flags */
+#define OBD_INCOMPAT_LMA 0x00000080
/* Data stored per server at the head of the last_rcvd file. In le32 order.
lsd->lsd_server_size = LR_SERVER_SIZE;
lsd->lsd_client_start = LR_CLIENT_START;
lsd->lsd_client_size = LR_CLIENT_SIZE;
+ lsd->lsd_feature_compat = OBD_COMPAT_MDT;
lsd->lsd_feature_rocompat = OBD_ROCOMPAT_LOVOBJID;
lsd->lsd_feature_incompat = OBD_INCOMPAT_MDT |
- OBD_INCOMPAT_COMMON_LR;
+ OBD_INCOMPAT_COMMON_LR;
} else {
LCONSOLE_WARN("%s: used disk, loading\n", obd->obd_name);
rc = mdt_last_rcvd_header_read(env, mdt);
obd->obd_uuid.uuid, lsd->lsd_uuid);
GOTO(out, rc = -EINVAL);
}
-
- /** evict all clients as it is first boot with old last_rcvd */
- if (!(lsd->lsd_feature_incompat & OBD_INCOMPAT_20)) {
- LCONSOLE_WARN("Mounting %s at first time on old FS, "
- "remove all clients for interop needs\n",
- obd->obd_name);
- simple_truncate(lsi->lsi_srv_mnt->mnt_sb->s_root,
- lsi->lsi_srv_mnt, LAST_RCVD,
- lsd->lsd_client_start);
- last_rcvd_size = lsd->lsd_client_start;
- }
+ lsd->lsd_feature_compat |= OBD_COMPAT_MDT;
+ lsd->lsd_feature_incompat |= OBD_INCOMPAT_MDT |
+ OBD_INCOMPAT_COMMON_LR;
}
mount_count = lsd->lsd_mount_count;
ldd = lsi->lsi_ldd;
+ if (lsd->lsd_feature_incompat & ~MDT_INCOMPAT_SUPP) {
+ CERROR("%s: unsupported incompat filesystem feature(s) %x\n",
+ obd->obd_name,
+ lsd->lsd_feature_incompat & ~MDT_INCOMPAT_SUPP);
+ GOTO(out, rc = -EINVAL);
+ }
+ if (lsd->lsd_feature_rocompat & ~MDT_ROCOMPAT_SUPP) {
+ CERROR("%s: unsupported read-only filesystem feature(s) %x\n",
+ obd->obd_name,
+ lsd->lsd_feature_rocompat & ~MDT_ROCOMPAT_SUPP);
+ /* XXX: Do something like remount filesystem read-only */
+ GOTO(out, rc = -EINVAL);
+ }
+ /** Interop: evict all clients at first boot with 1.8 last_rcvd */
+ if (!(lsd->lsd_feature_compat & OBD_COMPAT_20)) {
+ LCONSOLE_WARN("Mounting %s at first time on 1.8 FS, remove all"
+ " clients for interop needs\n", obd->obd_name);
+ simple_truncate(lsi->lsi_srv_mnt->mnt_sb->s_root,
+ lsi->lsi_srv_mnt, LAST_RCVD,
+ lsd->lsd_client_start);
+ last_rcvd_size = lsd->lsd_client_start;
+ /** set 2.0 flag to upgrade/downgrade between 1.8 and 2.0 */
+ lsd->lsd_feature_compat |= OBD_COMPAT_20;
+ }
+
if (ldd->ldd_flags & LDD_F_IAM_DIR)
lsd->lsd_feature_incompat |= OBD_INCOMPAT_IAM_DIR;
- lsd->lsd_feature_compat = 0;
- lsd->lsd_feature_incompat |= OBD_INCOMPAT_FID | OBD_INCOMPAT_20;
+ lsd->lsd_feature_incompat |= OBD_INCOMPAT_FID;
spin_lock(&mdt->mdt_transno_lock);
mdt->mdt_last_transno = lsd->lsd_last_transno;
fsd->lsd_client_size = cpu_to_le16(LR_CLIENT_SIZE);
fsd->lsd_subdir_count = cpu_to_le16(FILTER_SUBDIR_COUNT);
filter->fo_subdir_count = FILTER_SUBDIR_COUNT;
- fsd->lsd_feature_incompat = cpu_to_le32(OBD_INCOMPAT_OST);
+ /* OBD_COMPAT_OST is set in filter_connect_internal when the
+ * MDS first connects and assigns the OST index number. */
+ fsd->lsd_feature_incompat = cpu_to_le32(OBD_INCOMPAT_COMMON_LR|
+ OBD_INCOMPAT_OST);
} else {
rc = fsfilt_read_record(obd, filp, fsd, sizeof(*fsd), &off);
if (rc) {
cpu_to_le32(OBD_INCOMPAT_COMMON_LR)))
fsd->lsd_last_transno = fsd->lsd_compat14;
/* end COMPAT_146 */
+ /* OBD_COMPAT_OST is set in filter_connect_internal when the
+ * MDS first connects and assigns the OST index number. */
+ fsd->lsd_feature_incompat |= cpu_to_le32(OBD_INCOMPAT_COMMON_LR|
+ OBD_INCOMPAT_OST);
}
if (fsd->lsd_feature_incompat & ~cpu_to_le32(FILTER_INCOMPAT_SUPP)) {