diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-crypt.c | 19 | ||||
-rw-r--r-- | drivers/md/multipath.c | 2 | ||||
-rw-r--r-- | drivers/md/raid1.c | 2 | ||||
-rw-r--r-- | drivers/md/raid10.c | 2 | ||||
-rw-r--r-- | drivers/md/raid5.c | 2 | ||||
-rw-r--r-- | drivers/md/raid6main.c | 2 |
6 files changed, 10 insertions, 19 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 77619a56e2bf..0dd6c2b5391b 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -331,25 +331,19 @@ crypt_alloc_buffer(struct crypt_config *cc, unsigned int size, | |||
331 | struct bio *bio; | 331 | struct bio *bio; |
332 | unsigned int nr_iovecs = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; | 332 | unsigned int nr_iovecs = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; |
333 | int gfp_mask = GFP_NOIO | __GFP_HIGHMEM; | 333 | int gfp_mask = GFP_NOIO | __GFP_HIGHMEM; |
334 | unsigned long flags = current->flags; | ||
335 | unsigned int i; | 334 | unsigned int i; |
336 | 335 | ||
337 | /* | 336 | /* |
338 | * Tell VM to act less aggressively and fail earlier. | 337 | * Use __GFP_NOMEMALLOC to tell the VM to act less aggressively and |
339 | * This is not necessary but increases throughput. | 338 | * to fail earlier. This is not necessary but increases throughput. |
340 | * FIXME: Is this really intelligent? | 339 | * FIXME: Is this really intelligent? |
341 | */ | 340 | */ |
342 | current->flags &= ~PF_MEMALLOC; | ||
343 | |||
344 | if (base_bio) | 341 | if (base_bio) |
345 | bio = bio_clone(base_bio, GFP_NOIO); | 342 | bio = bio_clone(base_bio, GFP_NOIO|__GFP_NOMEMALLOC); |
346 | else | 343 | else |
347 | bio = bio_alloc(GFP_NOIO, nr_iovecs); | 344 | bio = bio_alloc(GFP_NOIO|__GFP_NOMEMALLOC, nr_iovecs); |
348 | if (!bio) { | 345 | if (!bio) |
349 | if (flags & PF_MEMALLOC) | ||
350 | current->flags |= PF_MEMALLOC; | ||
351 | return NULL; | 346 | return NULL; |
352 | } | ||
353 | 347 | ||
354 | /* if the last bio was not complete, continue where that one ended */ | 348 | /* if the last bio was not complete, continue where that one ended */ |
355 | bio->bi_idx = *bio_vec_idx; | 349 | bio->bi_idx = *bio_vec_idx; |
@@ -386,9 +380,6 @@ crypt_alloc_buffer(struct crypt_config *cc, unsigned int size, | |||
386 | size -= bv->bv_len; | 380 | size -= bv->bv_len; |
387 | } | 381 | } |
388 | 382 | ||
389 | if (flags & PF_MEMALLOC) | ||
390 | current->flags |= PF_MEMALLOC; | ||
391 | |||
392 | if (!bio->bi_size) { | 383 | if (!bio->bi_size) { |
393 | bio_put(bio); | 384 | bio_put(bio); |
394 | return NULL; | 385 | return NULL; |
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index c9b134cd1532..1891e4930dcc 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -355,7 +355,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number) | |||
355 | goto abort; | 355 | goto abort; |
356 | } | 356 | } |
357 | p->rdev = NULL; | 357 | p->rdev = NULL; |
358 | synchronize_kernel(); | 358 | synchronize_rcu(); |
359 | if (atomic_read(&rdev->nr_pending)) { | 359 | if (atomic_read(&rdev->nr_pending)) { |
360 | /* lost the race, try later */ | 360 | /* lost the race, try later */ |
361 | err = -EBUSY; | 361 | err = -EBUSY; |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index a389394b52f6..83380b5d6593 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -797,7 +797,7 @@ static int raid1_remove_disk(mddev_t *mddev, int number) | |||
797 | goto abort; | 797 | goto abort; |
798 | } | 798 | } |
799 | p->rdev = NULL; | 799 | p->rdev = NULL; |
800 | synchronize_kernel(); | 800 | synchronize_rcu(); |
801 | if (atomic_read(&rdev->nr_pending)) { | 801 | if (atomic_read(&rdev->nr_pending)) { |
802 | /* lost the race, try later */ | 802 | /* lost the race, try later */ |
803 | err = -EBUSY; | 803 | err = -EBUSY; |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index b100bfe4fdca..e9dc2876a626 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -977,7 +977,7 @@ static int raid10_remove_disk(mddev_t *mddev, int number) | |||
977 | goto abort; | 977 | goto abort; |
978 | } | 978 | } |
979 | p->rdev = NULL; | 979 | p->rdev = NULL; |
980 | synchronize_kernel(); | 980 | synchronize_rcu(); |
981 | if (atomic_read(&rdev->nr_pending)) { | 981 | if (atomic_read(&rdev->nr_pending)) { |
982 | /* lost the race, try later */ | 982 | /* lost the race, try later */ |
983 | err = -EBUSY; | 983 | err = -EBUSY; |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 52c3a81c4aa7..e96e2a10a9c9 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -1873,7 +1873,7 @@ static int raid5_remove_disk(mddev_t *mddev, int number) | |||
1873 | goto abort; | 1873 | goto abort; |
1874 | } | 1874 | } |
1875 | p->rdev = NULL; | 1875 | p->rdev = NULL; |
1876 | synchronize_kernel(); | 1876 | synchronize_rcu(); |
1877 | if (atomic_read(&rdev->nr_pending)) { | 1877 | if (atomic_read(&rdev->nr_pending)) { |
1878 | /* lost the race, try later */ | 1878 | /* lost the race, try later */ |
1879 | err = -EBUSY; | 1879 | err = -EBUSY; |
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index 7e30ab29691a..8a33f351e092 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -2038,7 +2038,7 @@ static int raid6_remove_disk(mddev_t *mddev, int number) | |||
2038 | goto abort; | 2038 | goto abort; |
2039 | } | 2039 | } |
2040 | p->rdev = NULL; | 2040 | p->rdev = NULL; |
2041 | synchronize_kernel(); | 2041 | synchronize_rcu(); |
2042 | if (atomic_read(&rdev->nr_pending)) { | 2042 | if (atomic_read(&rdev->nr_pending)) { |
2043 | /* lost the race, try later */ | 2043 | /* lost the race, try later */ |
2044 | err = -EBUSY; | 2044 | err = -EBUSY; |