Whamcloud - gitweb
Branch HEAD
authorscjody <scjody>
Wed, 21 Mar 2007 20:49:17 +0000 (20:49 +0000)
committerscjody <scjody>
Wed, 21 Mar 2007 20:49:17 +0000 (20:49 +0000)
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

lustre/llite/namei.c
lustre/obdfilter/filter.c
lustre/tests/openclose.c
lustre/tests/recovery-small.sh
lustre/tests/sanityN.sh

index e0101fa..fd33706 100644 (file)
@@ -811,7 +811,7 @@ static void ll_update_times(struct ptlrpc_request *request, int offset,
 }
 
 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;
index 9fae669..ab43a7e 100644 (file)
@@ -2807,12 +2807,12 @@ static int filter_precreate(struct obd_device *obd, struct obdo *oa,
                 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*/
@@ -3089,8 +3089,8 @@ cleanup:
         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;
 }
 
index 0a517fc..22c859c 100644 (file)
@@ -68,10 +68,10 @@ int main(int argc, char *argv[])
                                 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
@@ -97,43 +97,42 @@ int main(int argc, char *argv[])
 
                 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);
index ba292ca..5a5524d 100755 (executable)
@@ -75,12 +75,15 @@ test_5() {
 }
 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
@@ -89,16 +92,16 @@ run_test 7 "unlink: drop req, drop rep"
 
 #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)"
 
@@ -750,7 +753,7 @@ run_test 52 "failover OST under load"
 # 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"
@@ -827,7 +830,7 @@ test_55() {
 }
 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
index 56e5271..6045487 100644 (file)
@@ -412,7 +412,8 @@ test_14b() { # bug 3192, 7040
         $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"