Skip to content

Commit

Permalink
md: don't call md_allow_write in get_bitmap_file.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown committed Aug 27, 2013
1 parent d8dfad3 commit 60559da
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60559da

Please sign in to comment.