tbd Cluster File Systems, Inc. <info@clusterfs.com>
- * version 1.2.3
+ * version 1.2.4
* bug fixes
+ - don't cleanup request in ll_file_open() on failed MDS open (3430)
* miscellania
2004-06-17 Cluster File Systems, Inc. <info@clusterfs.com>
int rc = 0;
ENTRY;
- CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
- inode->i_generation, inode);
+ CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), flags %o\n", inode->i_ino,
+ inode->i_generation, inode, file->f_flags);
/* don't do anything for / */
if (inode->i_sb->s_root == file->f_dentry)
lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, LPROC_LL_OPEN);
rc = it_open_error(DISP_OPEN_OPEN, it);
+ /* mdc_intent_lock() didn't get a request ref if there was an open
+ * error, so don't do cleanup on the request here (bug 3430) */
if (rc)
- GOTO(out, rc);
+ RETURN(rc);
rc = ll_local_open(file, it);
- if (rc)
- LBUG();
+ LASSERTF(rc == 0, "rc = %d\n", rc);
if (!S_ISREG(inode->i_mode))
GOTO(out, rc);
ENTRY;
LASSERT(it);
- CDEBUG(D_DLMTRACE, "name: %*s in inode %ld, intent: %s\n", len, name,
- (unsigned long)pfid->id, ldlm_it2str(it->it_op));
+ CDEBUG(D_DLMTRACE, "name: %*s in inode "LPU64", intent: %s flags %#o\n",
+ len, name, pfid->id, ldlm_it2str(it->it_op), it->it_flags);
if (cfid && (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR)) {
/* We could just return 1 immediately, but since we should only
*/
if (it_disposition(it, DISP_OPEN_CREATE) &&
!it_open_error(DISP_OPEN_CREATE, it))
- ptlrpc_request_addref(request);
+ ptlrpc_request_addref(request); /* balanced in ll_create_node */
if (it_disposition(it, DISP_OPEN_OPEN) &&
!it_open_error(DISP_OPEN_OPEN, it))
- ptlrpc_request_addref(request);
+ ptlrpc_request_addref(request); /* balanced in ll_file_open */
if (it->it_op & IT_CREAT) {
- /* XXX this belongs in ll_create_iit */
+ /* XXX this belongs in ll_create_it */
} else if (it->it_op == IT_OPEN) {
LASSERT(!it_disposition(it, DISP_OPEN_CREATE));
} else {
LCONF=${LCONF:-lconf}
NAME=${NAME:-local}
+LLMOUNT=${LLMOUNT:-llmount}
config=$NAME.xml
mkconfig=$NAME.sh
${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt ${REFORMAT:---reformat} $@ \
$conf_opt || exit 2
+
+if [ "$MOUNT2" ]; then
+ $LLMOUNT -v `hostname`:/mds1/client $MOUNT2 || exit 3
+fi
[ "$NODE" ] && node_opt="--node $NODE"
sync; sleep 2; sync
+[ "$MOUNT2" ] && umount $MOUNT2
+
${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt --cleanup $@ \
--dump $TMP/debug $conf_opt
rc=$?
LCONF=${LCONF:-lconf}
NAME=${NAME:-local}
+LLMOUNT=${LLMOUNT:-llmount}
config=$NAME.xml
mkconfig=$NAME.sh
[ "$NODE" ] && node_opt="--node $NODE"
${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt $@ $conf_opt || exit 2
+
+if [ "$MOUNT2" ]; then
+ $LLMOUNT -v `hostname`:/mds1/client $MOUNT2 || exit 3
+fi
RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
fi
-export NAME=${NAME:-mount2}
-
SAVE_PWD=$PWD
clean() {
echo -n "cln.."
sh llmountcleanup.sh > /dev/null || exit 20
}
-CLEAN=${CLEAN:-clean}
+CLEAN=${CLEAN:-}
start() {
echo -n "mnt.."
sh llrmount.sh > /dev/null || exit 10
echo "done"
}
-START=${START:-start}
+START=${START:-}
log() {
echo "$*"
$DIR2/d14/ls && error || true
exec 100<&-
}
-run_test 14 "execution of file opened for write should return -ETXTBSY=="
+run_test 14 "execution of file open for write returns -ETXTBSY ="
test_14a() {
mkdir -p $DIR1/d14
- cp -p `which multiop` $DIR1/d14/multiop
+ cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
$DIR1/d14/multiop $TMP/test14.junk O_c &
MULTIPID=$!
sleep 1
kill -USR1 $MULTIPID || return 2
wait $MULTIPID || return 3
}
-run_test 14a "open(RDWR) of file being executed should return -ETXTBSY"
+run_test 14a "open(RDWR) of executing file returns -ETXTBSY ===="
test_14b() {
mkdir -p $DIR1/d14
- cp -p `which multiop` $DIR1/d14/multiop
+ cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
$DIR1/d14/multiop $TMP/test14.junk O_c &
MULTIPID=$!
sleep 1
kill -USR1 $MULTIPID || return 2
wait $MULTIPID || return 3
}
-run_test 14b "truncate of file being executed should return -ETXTBSY"
+run_test 14b "truncate of executing file return -ETXTBSY ======"
+
+test_14c() { # bug 3430
+ mkdir -p $DIR1/d14
+ cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
+ $DIR1/d14/multiop $TMP/test14.junk O_c &
+ MULTIPID=$!
+ sleep 1
+ cp /etc/hosts $DIR2/d14/multiop && error "expected error, got success"
+ kill -USR1 $MULTIPID || return 2
+ wait $MULTIPID || return 3
+ #cmp `which multiop` $DIR1/d14/multiop || error "binary changed"
+}
+run_test 14c "open(O_TRUNC) of executing file return -ETXTBSY =="
test_15() { # bug 974 - ENOSPC
echo $PATH