Remove "#if FOO" compiler warnings from -Wundef.
(Committed by adilger)
Define FMODE_READ and FMODE_WRITE for use in liblustre
(Committed by green)
Allow test 6 and 7 to be run in isolation.
Fix test file names.
Create test files in $DIR instead of $MOUNT.
(Committed by adilger)
openclose.c: Save errno before calling fprintf().
(Committed by adilger)
sanityN.sh: Kill multiop before exiting, if test fails.
Test is currently excluded, was retesting to see if it worked yet.
b=3192
(Committed by adilger)
r=adilger
r=nathan
r=green
}
static int ll_new_node(struct inode *dir, struct qstr *name,
- char *tgt, int mode,
+ const char *tgt, int mode,
int rdev, struct dentry *dchild)
{
struct ptlrpc_request *request = NULL;
dparent = filter_parent_lock(obd, group, next_id);
if (IS_ERR(dparent))
GOTO(cleanup, rc = PTR_ERR(dparent));
- cleanup_phase = 1;
+ cleanup_phase = 1; /* filter_parent_unlock(dparent) */
dchild = filter_fid2dentry(obd, dparent, group, next_id);
if (IS_ERR(dchild))
GOTO(cleanup, rc = PTR_ERR(dchild));
- cleanup_phase = 2;
+ cleanup_phase = 2; /* f_dput(dchild) */
if (dchild->d_inode != NULL) {
/* This would only happen if lastobjid was bad on disk*/
qcids[GRPQUOTA] = oa->o_gid;
rc2 = lquota_adjust(filter_quota_interface_ref, obd, qcids, NULL, rc,
FSFILT_OP_UNLINK);
- CDEBUG(rc2 ? D_ERROR : D_QUOTA,
- "filter adjust qunit! (rc:%d)\n", rc2);
+ if (rc2)
+ CERROR("filter adjust qunit! (rc:%d)\n", rc2);
return rc;
}
continue;
if (ret < 0) {
- fprintf(stderr, "error: %s: wait - %s\n",
- argv[0], strerror(errno));
if (!rc)
rc = errno;
+ fprintf(stderr, "error: %s: wait - %s\n",
+ argv[0], strerror(rc));
} else {
/*
* This is a hack. We _should_ be able to use
fd = open(filename, O_RDWR|O_CREAT, 0644);
if (fd < 0) {
+ rc = errno;
fprintf(stderr, "open(%s, O_CREAT): %s\n", filename,
- strerror(errno));
- exit(errno);
+ strerror(rc));
+ exit(rc);
}
if (close(fd) < 0) {
- fprintf(stderr, "close(): %s\n", strerror(errno));
rc = errno;
+ fprintf(stderr, "close(): %s\n", strerror(rc));
goto unlink;
}
for (i = 0; i < count; i++) {
fd = open(filename, O_RDWR|O_LARGEFILE|O_DIRECT);
if (fd < 0) {
- fprintf(stderr, "open(%s, O_RDWR): %s\n",
- filename, strerror(errno));
rc = errno;
+ fprintf(stderr, "open(%s, O_RDWR): %s\n",
+ filename, strerror(rc));
break;
}
if (ioctl(fd, LL_IOC_SETFLAGS, &ioctl_flags) < 0 &&
errno != ENOTTY) {
- fprintf(stderr, "ioctl(): %s\n",
- strerror(errno));
rc = errno;
+ fprintf(stderr, "ioctl(): %s\n", strerror(rc));
break;
}
if (close(fd) < 0) {
- fprintf(stderr, "close(): %s\n",
- strerror(errno));
rc = errno;
+ fprintf(stderr, "close(): %s\n", strerror(rc));
break;
}
}
unlink:
if (unlink(filename) < 0) {
- fprintf(stderr, "unlink(%s): %s\n", filename,
- strerror(errno));
rc = errno;
+ fprintf(stderr, "unlink(%s): %s\n", filename,
+ strerror(rc));
}
if (threads)
printf("Thread %d done: rc = %d\n", thread, rc);
}
run_test 5 "rename: drop req, drop rep"
+[ ! -e $MOUNT/renamed-again ] && cp /etc/inittab $MOUNT/renamed-again
test_6() {
drop_request "mlink $MOUNT/renamed-again $MOUNT/link1" || return 1
drop_reint_reply "mlink $MOUNT/renamed-again $MOUNT/link2" || return 2
}
run_test 6 "link: drop req, drop rep"
+[ ! -e $MOUNT/link1 ] && mlink $MOUNT/renamed-again $MOUNT/link1
+[ ! -e $MOUNT/link2 ] && mlink $MOUNT/renamed-again $MOUNT/link2
test_7() {
drop_request "munlink $MOUNT/link1" || return 1
drop_reint_reply "munlink $MOUNT/link2" || return 2
#bug 1423
test_8() {
- drop_reint_reply "touch $MOUNT/renamed" || return 1
+ drop_reint_reply "touch $MOUNT/$tfile" || return 1
}
run_test 8 "touch: drop rep (bug 1423)"
#bug 1420
test_9() {
- pause_bulk "cp /etc/profile $MOUNT" || return 1
- do_facet client "cp /etc/termcap $MOUNT" || return 2
+ pause_bulk "cp /etc/profile $MOUNT/$tfile" || return 1
+ do_facet client "cp /etc/termcap $MOUNT/${tfile}.2" || return 2
do_facet client "sync"
- do_facet client "rm $MOUNT/termcap $MOUNT/profile" || return 3
+ do_facet client "rm $MOUNT/$tfile $MOUNT/${tfile}.2" || return 3
}
run_test 9 "pause bulk on OST (bug 1420)"
# test of open reconstruct
test_53() {
touch $DIR/$tfile
- drop_ldlm_reply "./openfile -f O_RDWR:O_CREAT -m 0755 $MOUNT/$tfile" ||\
+ drop_ldlm_reply "./openfile -f O_RDWR:O_CREAT -m 0755 $DIR/$tfile" ||\
return 2
}
run_test 53 "touch: drop rep"
}
run_test 55 "ost_brw_read/write drops timed-out read/write request"
-test_56() {
+test_56() { # b=11277
#define OBD_FAIL_MDS_RESEND 0x136
touch $MOUNT/$tfile
do_facet mds sysctl -w lustre.fail_loc=0x80000136
$DIR1/d14/multiop $TMP/test14.junk O_c &
MULTIPID=$!
sleep 1
- truncate $DIR2/d14/multiop 0 && error "expected error, got success"
+ truncate $DIR2/d14/multiop 0 && kill -9 $MULTIPID && \
+ error "expected truncate error, got success"
kill -USR1 $MULTIPID || return 2
wait $MULTIPID || return 3
cmp `which multiop` $DIR1/d14/multiop || error "binary changed"