@@ -478,6 +478,7 @@
#define OBD_FAIL_FLR_GLIMPSE_IMMUTABLE 0x1A00
#define OBD_FAIL_FLR_LV_DELAY 0x1A01
#define OBD_FAIL_FLR_LV_INC 0x1A02
+#define OBD_FAIL_FLR_RANDOM_PICK_MIRROR 0x1A03
/* Assign references to moved code to reduce code changes */
#define OBD_FAIL_PRECHECK(id) CFS_FAIL_PRECHECK(id)
@@ -188,6 +188,10 @@ int cl_file_inode_init(struct inode *inode, struct lustre_md *md)
}
} else {
result = cl_conf_set(env, lli->lli_clob, &conf);
+ if (result == -EBUSY) {
+ /* ignore the error since I/O will handle it later */
+ result = 0;
+ }
}
cl_env_put(env, &refcheck);
@@ -756,6 +756,25 @@ static int lov_init_composite(const struct lu_env *env, struct lov_device *dev,
goto out;
}
+ if (OBD_FAIL_CHECK(OBD_FAIL_FLR_RANDOM_PICK_MIRROR)) {
+ unsigned int seq;
+
+ get_random_bytes(&seq, sizeof(seq));
+ seq %= mirror_count;
+
+ i = 0;
+ lov_foreach_mirror_entry(lov, lre) {
+ i++;
+ if (lre->lre_stale)
+ continue;
+
+ if (!seq--) {
+ comp->lo_preferred_mirror = i - 1;
+ break;
+ }
+ }
+ }
+
LASSERT(comp->lo_preferred_mirror >= 0);
out: