md: don't call md_allow_write in get_bitmap_file.
authorNeilBrown <neilb@suse.de>
Tue, 16 Jul 2013 06:44:29 +0000 (16:44 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 27 Aug 2013 06:05:32 +0000 (16:05 +1000)
There is no really need as GFP_NOIO is very likely sufficient,
and failure is not catastrophic.

Calling md_allow_write here will convert a read-auto array to
read/write which could be confusing when you are just performing
a read operation.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 9f13e13506efbb3859786879ed6a5ff42eb72e8f..bba87324c9b25ac40e3a46b791771996d8e3c9dc 100644 (file)
@@ -5628,10 +5628,7 @@ static int get_bitmap_file(struct mddev * mddev, void __user * arg)
        char *ptr, *buf = NULL;
        int err = -ENOMEM;
 
-       if (md_allow_write(mddev))
-               file = kmalloc(sizeof(*file), GFP_NOIO);
-       else
-               file = kmalloc(sizeof(*file), GFP_KERNEL);
+       file = kmalloc(sizeof(*file), GFP_NOIO);
 
        if (!file)
                goto out;