Commit 6da79789 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Md sync: Remove compiler warning that revealed a bug.

When we abort a resync before we even started (because we were
interrupted while waiting for a conflicting resync to finish)
we should not wait or, particularly, do the closing sync_request
(as we haven't even calculated max_sectors yet).
parent b1f6b684
...@@ -3230,7 +3230,7 @@ static void md_do_sync(void *data) ...@@ -3230,7 +3230,7 @@ static void md_do_sync(void *data)
flush_curr_signals(); flush_curr_signals();
err = -EINTR; err = -EINTR;
mddev_put(mddev2); mddev_put(mddev2);
goto out; goto skip;
} }
} }
} }
...@@ -3331,11 +3331,11 @@ static void md_do_sync(void *data) ...@@ -3331,11 +3331,11 @@ static void md_do_sync(void *data)
/* /*
* this also signals 'finished resyncing' to md_stop * this also signals 'finished resyncing' to md_stop
*/ */
out: out:
wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));
/* tell personality that we are finished */ /* tell personality that we are finished */
mddev->pers->sync_request(mddev, max_sectors, 1); mddev->pers->sync_request(mddev, max_sectors, 1);
skip:
mddev->curr_resync = 0; mddev->curr_resync = 0;
if (err) if (err)
mddev->recovery_running = err; mddev->recovery_running = err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment