]>
Commit | Line | Data |
---|---|---|
3180c269 GKH |
1 | From arnd@arndb.de Thu Apr 27 11:57:34 2017 |
2 | From: Arnd Bergmann <arnd@arndb.de> | |
3 | Date: Fri, 21 Apr 2017 15:41:10 +0200 | |
4 | Subject: dm bufio: hide bogus warning | |
5 | To: stable@vger.kernel.org | |
6 | Cc: gregkh@linuxfoundation.org, Arnd Bergmann <arnd@arndb.de>, Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@redhat.com>, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org | |
7 | Message-ID: <20170421134212.2727744-1-arnd@arndb.de> | |
8 | ||
9 | From: Arnd Bergmann <arnd@arndb.de> | |
10 | ||
11 | mips-gcc-5.3 warns about correct code on linux-3.18 and earlier: | |
12 | ||
13 | In file included from ../include/linux/blkdev.h:4:0, | |
14 | from ../drivers/md/dm-bufio.h:12, | |
15 | from ../drivers/md/dm-bufio.c:9: | |
16 | ../drivers/md/dm-bufio.c: In function 'alloc_buffer': | |
17 | ../include/linux/sched.h:1975:56: warning: 'noio_flag' may be used uninitialized in this function [-Wmaybe-uninitialized] | |
18 | current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags; | |
19 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ | |
20 | ../drivers/md/dm-bufio.c:325:11: note: 'noio_flag' was declared here | |
21 | ||
22 | The warning disappeared on later kernels with this commit: be0c37c985ed | |
23 | ("MIPS: Rearrange PTE bits into fixed positions.") I assume this only | |
24 | happened because it changed some inlining decisions. | |
25 | ||
26 | On 3.18.y, we can shut up the warning by adding an extra initialization. | |
27 | ||
28 | Signed-off-by: Arnd Bergmann <arnd@arndb.de> | |
29 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
30 | --- | |
31 | drivers/md/dm-bufio.c | 1 + | |
32 | 1 file changed, 1 insertion(+) | |
33 | ||
34 | --- a/drivers/md/dm-bufio.c | |
35 | +++ b/drivers/md/dm-bufio.c | |
36 | @@ -349,6 +349,7 @@ static void *alloc_buffer_data(struct dm | |
37 | * as if GFP_NOIO was specified. | |
38 | */ | |
39 | ||
40 | + noio_flag = 0; | |
41 | if (gfp_mask & __GFP_NORETRY) | |
42 | noio_flag = memalloc_noio_save(); | |
43 |