From: Nathan Scott Date: Thu, 18 Apr 2002 06:04:04 +0000 (+0000) Subject: sync with kernel changes to fix error code return checking. X-Git-Tag: v2.1.0~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=606d804d64f543d7949c7d964d8426284dc77080;p=thirdparty%2Fxfsprogs-dev.git sync with kernel changes to fix error code return checking. --- diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c index c1c31baca..5134e3d21 100644 --- a/libxlog/xfs_log_recover.c +++ b/libxlog/xfs_log_recover.c @@ -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