aboutsummaryrefslogtreecommitdiffstats
path: root/features/vfat/fat-don-t-use-obsolete-random32-call-in-namei_vfat.patch
blob: cfa3d747fd1a484a5efe63e383491165a9f33902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From b4213d81ea3f36176fafe2dd2326cb6b0544c2ed Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Sat, 27 Sep 2014 12:01:21 -0400
Subject: [PATCH] fat: don't use obsolete random32 call in namei_vfat

Introduced in commit 16b6ba6d7f6b0e8a2baeb14b128df0bb0a0a5680
("FAT: Add CONFIG_VFAT_FS_NO_DUALNAMES option"), the use of
random32 is no longer allowed.

The compatibility wrappers have been removed, so we have to
align the additions from this older patch to match upstream
commit 496f2f93b1cc286f5a4f4f9acdc1e5314978683f ("random32: rename
random32 to prandom")  which does:

    This renames all random32 functions to have 'prandom_' prefix as follows:

      void prandom_seed(u32 seed);      /* rename from srandom32() */
      u32 prandom_u32(void);            /* rename from random32() */

    [...]

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 fs/fat/namei_vfat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 570f956da05d..a0b486c1c68f 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -617,7 +617,7 @@ static void vfat_build_dummy_83_buffer(struct inode *dir, char *msdos_name,
 				     0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x22, 0x2a,
 				     0x3a, 0x3c, 0x3e, 0x3f, 0x5b, 0x5d, 0x7c };
 	int i, tilde_pos, slash_pos;
-	u32 rand_num = random32();
+	u32 rand_num = prandom_u32();
 
 	/* We need a '~' in the prefix to make Win98 happy. */
 	tilde_pos = rand_num % 8;
@@ -652,7 +652,7 @@ static void vfat_build_dummy_83_buffer(struct inode *dir, char *msdos_name,
 				invalidchar[rand_num % sizeof(invalidchar)];
 			rand_num /= sizeof(invalidchar);
 			if (rand_num < sizeof(invalidchar))
-				rand_num = random32();
+				rand_num = prandom_u32();
 		}
 	}
 }
-- 
1.8.1.2