client won't use it anyways. Regression test for same.
Fix secondary bug hit during regression tests in mds_mfd_close() cleanup.
b=2983
+tbd Cluster File Systems, Inc. <info@clusterfs.com>
+ * version 1.2.x
+ * Bug fixes
+ - don't copy lvb into (possibly NULL) reply on error (2983)
+
2004-03-22 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.1
* bug fixes
- don't oops on a deleted current working directory (2399)
- handle hard links to targets without a parent properly (2517)
- don't dereference NULL lock when racing during eviction (2867)
- - don't grow lock extents when there are lots of conflicting locks (2919)
+ - don't grow lock extents when lots of conflicting locks (2919)
2004-03-04 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.0
#define OBD_FAIL_LDLM_BL_CALLBACK 0x305
#define OBD_FAIL_LDLM_CP_CALLBACK 0x306
#define OBD_FAIL_LDLM_GL_CALLBACK 0x307
+#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
+#define OBD_FAIL_LDLM_ENQUEUE_INTENT_ERR 0x309
#define OBD_FAIL_OSC 0x400
#define OBD_FAIL_OSC_BRW_READ_BULK 0x401
buffers = 2;
}
+ if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR))
+ GOTO(out, rc = -ENOMEM);
+
rc = lustre_pack_reply(req, buffers, size, NULL);
if (rc)
GOTO(out, rc);
err = lustre_pack_reply(req, 0, NULL, NULL);
if (rc == 0)
rc = err;
+ req->rq_status = rc;
}
/* The LOCK_CHANGED code in ldlm_lock_enqueue depends on this
LDLM_DEBUG(lock, "server-side enqueue handler, sending reply"
"(err=%d, rc=%d)", err, rc);
- if (lock->l_resource->lr_lvb_len > 0) {
+ if (lock->l_resource->lr_lvb_len > 0 && rc == 0) {
void *lvb = lustre_msg_buf(req->rq_repmsg, 1,
lock->l_resource->lr_lvb_len);
+ LASSERT(lvb != NULL);
memcpy(lvb, lock->l_resource->lr_lvb_data,
lock->l_resource->lr_lvb_len);
}
{
int flags = MDS_OPEN_HAS_OBJS | FMODE_WRITE;
struct lov_user_md *lump;
- int lum_size = sizeof(struct lov_user_md) +
+ int lum_size = sizeof(struct lov_user_md) +
sizeof(struct lov_user_ost_data);
int rc;
ENTRY;
if (lump == NULL) {
RETURN(-ENOMEM);
}
- rc = copy_from_user(lump, (struct lov_user_md *)arg,
- lum_size);
+ rc = copy_from_user(lump, (struct lov_user_md *)arg, lum_size);
if (rc) {
OBD_FREE(lump, lum_size);
RETURN(-EFAULT);
case LL_IOC_LOV_SETSTRIPE:
RETURN(ll_lov_setstripe(inode, file, arg));
case LL_IOC_LOV_SETEA:
- RETURN( ll_lov_setea(inode, file, arg) );
+ RETURN(ll_lov_setea(inode, file, arg));
case LL_IOC_LOV_GETSTRIPE:
RETURN(ll_lov_getstripe(inode, arg));
case LL_IOC_RECREATE_OBJ:
struct mdc_rpc_lock *rpc_lock, int level)
{
int rc;
-
request->rq_send_state = level;
RETURN(0);
}
-
if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_MDS_ALLOC_OBDO))
GOTO(out_ids, rc = -ENOMEM);
OBD_MD_FLCTIME);
if (!(rec->ur_flags & MDS_OPEN_HAS_OBJS)) {
- /* check if things like lstripe/lfs stripe are sending us the ea */
+ /* check if things like lfs setstripe are sending us the ea */
if (rec->ur_flags & MDS_OPEN_HAS_EA) {
- rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
+ rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
mds->mds_osc_exp,
0, &lsm, rec->ur_eadata);
if (rc)
if ((rec->ur_flags & MDS_OPEN_DIRECTORY) &&
!S_ISDIR(dchild->d_inode->i_mode))
GOTO(cleanup, rc = -ENOTDIR);
-
- if (S_ISDIR(dchild->d_inode->i_mode)) {
- if (rec->ur_flags & MDS_OPEN_CREAT || rec->ur_flags & FMODE_WRITE) {
+
+ if (S_ISDIR(dchild->d_inode->i_mode)) {
+ if (rec->ur_flags & MDS_OPEN_CREAT ||
+ rec->ur_flags & FMODE_WRITE) {
/*we are tryying to create or write a exist dir*/
GOTO(cleanup, rc = -EISDIR);
}
void *handle = NULL;
struct mds_body *request_body = NULL, *reply_body = NULL;
struct dentry_params dp;
- struct lov_mds_md *lmm;
ENTRY;
if (req != NULL) {
}
if (last_orphan && unlink_orphan) {
+ int stripe_count = 0;
LASSERT(rc == 0); /* mds_put_write_access must have succeeded */
CDEBUG(D_HA, "destroying orphan object %s\n", fidname);
LASSERT(pending_child->d_inode != NULL);
cleanup_phase = 2; /* dput(pending_child) when finished */
- lmm = lustre_msg_buf(req->rq_repmsg, 1, 0);
- handle = fsfilt_start_log(obd, pending_dir,
- FSFILT_OP_UNLINK, NULL,
- le32_to_cpu(lmm->lmm_stripe_count));
+ if (req != NULL) {
+ struct lov_mds_md *lmm = lustre_msg_buf(req->rq_repmsg,
+ 1, 0);
+ stripe_count = le32_to_cpu(lmm->lmm_stripe_count);
+ }
+
+ handle = fsfilt_start_log(obd, pending_dir, FSFILT_OP_UNLINK,
+ NULL, stripe_count);
if (IS_ERR(handle)) {
rc = PTR_ERR(handle);
handle = NULL;
GOTO(cleanup, rc);
}
- if (req != NULL &&
- (reply_body->valid & OBD_MD_FLEASIZE) &&
+ if (req != NULL && (reply_body->valid & OBD_MD_FLEASIZE) &&
mds_log_op_unlink(obd, pending_child->d_inode,
lustre_msg_buf(req->rq_repmsg, 1, 0),
req->rq_repmsg->buflens[1],
set -e
+# 17 = bug 2732 2986
+ALWAYS_EXCEPT="17 19b"
+
LUSTRE=${LUSTRE:-`dirname $0`/..}
UPCALL=${UPCALL:-$PWD/recovery-small-upcall.sh}
. $LUSTRE/tests/test-framework.sh
drop_ldlm_cancel multiop $f Ow || echo "client evicted, as expected"
do_facet client munlink $f || return 4
-
}
run_test 19b "test expired_lock_main on ost (2867)"
+test_20a() { # bug 2983 - ldlm_handle_enqueue cleanup
+ mkdir -p $DIR/$tdir
+ multiop $DIR/$tdir/${tfile} O_wc &
+ MULTI_PID=$!
+ usleep 500
+ cancel_lru_locks OSC
+#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
+ do_facet ost sysctl -w lustre.fail_loc=0x80000308
+ set -vx
+ kill -USR1 $MULTI_PID
+ wait $MULTI_PID
+ rc=$?
+ [ $rc -eq 0 ] && error "multiop didn't fail enqueue: rc $rc" || true
+ set +vx
+}
+run_test 20a "ldlm_handle_enqueue error (should return error)"
+
+test_20b() { # bug 2986 - ldlm_handle_enqueue error during open
+ mkdir $DIR/$tdir
+ touch $DIR/$tdir/${tfile}
+ cancel_lru_locks OSC
+#define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
+ do_facet ost sysctl -w lustre.fail_loc=0x80000308
+ dd if=/etc/hosts of=$DIR/$tdir/$tfile && \
+ error "didn't fail open enqueue" || true
+}
+run_test 20b "ldlm_handle_enqueue error (should return error)"
+
$CLEANUP