]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
sync with kernel changes to fix error code return checking.
authorNathan Scott <nathans@sgi.com>
Thu, 18 Apr 2002 06:04:04 +0000 (06:04 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 18 Apr 2002 06:04:04 +0000 (06:04 +0000)
libxlog/xfs_log_recover.c

index c1c31baca3d799b4667afb998e3f60b7fb2497c1..5134e3d21bbd75789079908612d61cb63c88bf77 100644 (file)
@@ -364,8 +364,12 @@ xlog_find_head(xlog_t  *log,
        start_blk = head_blk - num_scan_bblks;
        new_blk = xlog_find_verify_cycle(log, start_blk, num_scan_bblks,
                                         stop_on_cycle);
-       if (new_blk != -1)
+       if (new_blk >= 0)
            head_blk = new_blk;
+       else if (new_blk != -1) {
+           error = new_blk;
+           goto bp_err;
+       }
     } else {                   /* need to read 2 parts of log */
         /*
         * We are going to scan backwards in the log in two parts.  First
@@ -396,9 +400,12 @@ xlog_find_head(xlog_t  *log,
        ASSERT(head_blk <= INT_MAX && (xfs_daddr_t) num_scan_bblks-head_blk >= 0);
        new_blk= xlog_find_verify_cycle(log, start_blk,
                     num_scan_bblks-(int)head_blk, (stop_on_cycle - 1));
-       if (new_blk != -1) {
+       if (new_blk >= 0) {
            head_blk = new_blk;
            goto bad_blk;
+       } else if (new_blk != -1) {
+               error = new_blk;
+               goto bp_err;
        }
 
        /*
@@ -410,8 +417,12 @@ xlog_find_head(xlog_t  *log,
        ASSERT(head_blk <= INT_MAX);
        new_blk = xlog_find_verify_cycle(log, start_blk, (int) head_blk,
                                         stop_on_cycle);
-       if (new_blk != -1)
+       if (new_blk >= 0)
            head_blk = new_blk;
+       else if (new_blk != -1) {
+               error = new_blk;
+               goto bp_err;
+       }
     }
 
 bad_blk:
@@ -734,8 +745,12 @@ xlog_find_zeroed(struct log        *log,
         */
        new_blk = xlog_find_verify_cycle(log, start_blk,
                                         (int)num_scan_bblks, 0);
-       if (new_blk != -1)
+       if (new_blk >= 0)
                last_blk = new_blk;
+       else if (new_blk != -1) {
+               error = new_blk;
+               goto bp_err;
+       }
 
        /*
         * Potentially backup over partial log record write.  We don't need