__u8 lcd_padding[LR_CLIENT_SIZE - 128];
};
+/* bug20354: the lcd_uuid for export of clients may be wrong */
+static inline void check_lcd(char *obd_name, int index,
+ struct lsd_client_data *lcd)
+{
+ int length = sizeof(lcd->lcd_uuid);
+ if (strnlen((char*)lcd->lcd_uuid, length) == length) {
+ lcd->lcd_uuid[length - 1] = '\0';
+
+ LCONSOLE_ERROR("the client UUID (%s) on %s for exports"
+ "stored in last_rcvd(index = %d) is bad!\n",
+ lcd->lcd_uuid, obd_name, index);
+ }
+}
+
/* last_rcvd handling */
static inline void lsd_le_to_cpu(struct lr_server_data *buf,
struct lr_server_data *lsd)
RETURN(rc);
}
-static int mdt_last_rcvd_read(const struct lu_env *env,
- struct mdt_device *mdt,
- struct lsd_client_data *lcd, loff_t *off)
+static int mdt_last_rcvd_read(const struct lu_env *env, struct mdt_device *mdt,
+ struct lsd_client_data *lcd, loff_t *off,
+ int index)
{
struct mdt_thread_info *mti;
struct lsd_client_data *tmp;
tmp = &mti->mti_lcd;
rc = dt_record_read(env, mdt->mdt_last_rcvd,
mdt_buf(env, tmp, sizeof(*tmp)), off);
- if (rc == 0)
+ if (rc == 0) {
+ check_lcd(mdt2obd_dev(mdt)->obd_name, index, tmp);
lcd_le_to_cpu(tmp, lcd);
+ }
CDEBUG(D_INFO, "read lcd @%d rc = %d, uuid = %s, last_transno = "LPU64
", last_xid = "LPU64", last_result = %u, last_data = %u, "
off = lsd->lsd_client_start +
cl_idx * lsd->lsd_client_size;
- rc = mdt_last_rcvd_read(env, mdt, lcd, &off);
+ rc = mdt_last_rcvd_read(env, mdt, lcd, &off, cl_idx);
if (rc) {
CERROR("error reading MDS %s idx %d, off %llu: rc %d\n",
LAST_RCVD, cl_idx, off, rc);