]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
raid10: increment write counter after bio is split
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Thu, 28 Jul 2016 08:28:25 +0000 (10:28 +0200)
committerShaohua Li <shli@fb.com>
Sat, 30 Jul 2016 21:09:30 +0000 (14:09 -0700)
md pending write counter must be incremented after bio is split,
otherwise it gets decremented too many times in end bio callback and
becomes negative.

Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid10.c

index ed29fc899f068943203480d01e1401b6adabe167..1a632a8c80050b0ef632496ca51bdadec354e117 100644 (file)
@@ -1064,6 +1064,8 @@ static void __make_request(struct mddev *mddev, struct bio *bio)
        int max_sectors;
        int sectors;
 
+       md_write_start(mddev, bio);
+
        /*
         * Register the new request and wait if the reconstruction
         * thread has put up a bar for new requests.
@@ -1445,8 +1447,6 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio)
                return;
        }
 
-       md_write_start(mddev, bio);
-
        do {
 
                /*