#define OBD_FAIL_OSC_BRW_WRITE_BULK 0x402
#define OBD_FAIL_OSC_LOCK_BL_AST 0x403
#define OBD_FAIL_OSC_LOCK_CP_AST 0x404
+#define OBD_FAIL_OSC_MATCH 0x405
#define OBD_FAIL_PTLRPC 0x500
#define OBD_FAIL_PTLRPC_ACK 0x501
}
static int osc_match(struct obd_export *exp, struct lov_stripe_md *lsm,
- __u32 type, void *extentp, int extent_len, __u32 mode,
- int *flags, void *data, struct lustre_handle *lockh)
+ __u32 type, void *extentp, int extent_len, __u32 mode,
+ int *flags, void *data, struct lustre_handle *lockh)
{
struct ldlm_res_id res_id = { .name = {lsm->lsm_object_id} };
struct obd_device *obd = exp->exp_obd;
int rc;
ENTRY;
+ OBD_FAIL_RETURN(OBD_FAIL_OSC_MATCH, -EIO);
+
/* Filesystem lock extents are extended to page boundaries so that
* dealing with the page cache is a little smoother */
extent->start -= extent->start & ~PAGE_MASK;
}
run_test 61 "mmap() writes don't make sync hang =========="
+# bug 2330 - insufficient obd_match error checking causes LBUG
+test_62() {
+ f="$DIR/f62"
+ echo foo > $f
+ cancel_lru_locks OSC
+ echo 0x405 > /proc/sys/lustre/fail_loc
+ cat $f && error # expect -EIO
+ multiop $f Owc && error
+ echo 0 > /proc/sys/lustre/fail_loc
+}
+run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)"
+
# on the LLNL clusters, runas will still pick up root's $TMP settings,
# which will not be writable for the runas user, and then you get a CVS
# error message with a corrupt path string (CVS bug) and panic.