]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
md: MD_RECOVERY_NEEDED is set for mddev->recovery
authorShaohua Li <shli@fb.com>
Thu, 8 Dec 2016 23:48:18 +0000 (15:48 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 26 Jan 2017 16:40:18 +0000 (17:40 +0100)
commit 82a301cb0ea2df8a5c88213094a01660067c7fb4 upstream.

Fixes: 90f5f7ad4f38("md: Wait for md_check_recovery before attempting device
removal.")

Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/md/md.c

index 81bf511b3182e50932c7a842d7bdbbb9f9b3fcb4..87e8cd29ca5f87b91d9cffdc8078919135e0227b 100644 (file)
@@ -6431,7 +6431,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
                /* need to ensure recovery thread has run */
                wait_event_interruptible_timeout(mddev->sb_wait,
                                                 !test_bit(MD_RECOVERY_NEEDED,
-                                                          &mddev->flags),
+                                                          &mddev->recovery),
                                                 msecs_to_jiffies(5000));
        if (cmd == STOP_ARRAY || cmd == STOP_ARRAY_RO) {
                /* Need to flush page cache, and ensure no-one else opens