]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.27.46/tmpfs-mpol-bind-0-don-t-cause-mount-error.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.46 / tmpfs-mpol-bind-0-don-t-cause-mount-error.patch
1 From d69b2e63e9172afb4d07c305601b79a55509ac4c Mon Sep 17 00:00:00 2001
2 From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
3 Date: Tue, 23 Mar 2010 13:35:30 -0700
4 Subject: tmpfs: mpol=bind:0 don't cause mount error.
5
6 From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
7
8 commit d69b2e63e9172afb4d07c305601b79a55509ac4c upstream.
9
10 Currently, following mount operation cause mount error.
11
12 % mount -t tmpfs -ompol=bind:0 none /tmp
13
14 Because commit 71fe804b6d5 (mempolicy: use struct mempolicy pointer in
15 shmem_sb_info) corrupted MPOL_BIND parse code.
16
17 This patch restore the needed one.
18
19 Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
20 Cc: Ravikiran Thirumalai <kiran@scalex86.org>
21 Cc: Christoph Lameter <cl@linux-foundation.org>
22 Cc: Mel Gorman <mel@csn.ul.ie>
23 Acked-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
24 Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
25 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
26 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
28
29 ---
30 mm/mempolicy.c | 10 +++++++---
31 1 file changed, 7 insertions(+), 3 deletions(-)
32
33 --- a/mm/mempolicy.c
34 +++ b/mm/mempolicy.c
35 @@ -2056,9 +2056,13 @@ int mpol_parse_str(char *str, struct mem
36 if (!nodelist)
37 err = 0;
38 goto out;
39 - /*
40 - * case MPOL_BIND: mpol_new() enforces non-empty nodemask.
41 - */
42 + case MPOL_BIND:
43 + /*
44 + * Insist on a nodelist
45 + */
46 + if (!nodelist)
47 + goto out;
48 + err = 0;
49 }
50
51 mode_flags = 0;