60dcf07e8a1b8595cf21f5bd995a730f074bc960
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / linus / 0037-Revert-Staging-zram-work-around-oops-due-to-startup-.patch
1 From e983dc2428164698571e1dd1b25c4322181adbac Mon Sep 17 00:00:00 2001
2 From: Nitin Gupta <ngupta@vflare.org>
3 Date: Thu, 30 Dec 2010 04:07:58 -0500
4 Subject: [PATCH 37/66] Revert "Staging: zram: work around oops due to startup ordering snafu"
6 This reverts commit 7e24cce38a99f373450db67bf576fe73e8168d66 because it
7 was never appropriate for mainline.
9 Do not check for init flag before starting I/O - zram module is unusable
10 without this fix.
12 The oops mentioned in the reverted commit message was actually a problem
13 only with the zram version as present in project's own repository where
14 we allocate struct zram_stats_cpu upon device initialization. OTOH, In
15 mainline/staging version of zram, we allocate struct stats upfront, so
16 this oops cannot happen in mainline version.
18 Checking for init_done flag in zram_make_request() results in a *no-op*
19 for any I/O operation since we simply always return success. This flag
20 is actually set when the first write occurs on a zram disk which
21 triggers its initialization.
23 Bug report: https://bugzilla.kernel.org/show_bug.cgi?id=25722
25 Reported-by: Dennis Jansen <dennis.jansen@web.de>
26 Signed-off-by: Nitin Gupta <ngupta@vflare.org>
27 Cc: Anton Blanchard <anton@samba.org>
28 Cc: Andrew Morton <akpm@linux-foundation.org>
29 Cc: Greg Kroah-Hartman <gregkh@suse.de>
30 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
31 ---
32 drivers/staging/zram/zram_drv.c | 6 ------
33 1 files changed, 0 insertions(+), 6 deletions(-)
35 diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
36 index 8c3c057..d0e9e02 100644
37 --- a/drivers/staging/zram/zram_drv.c
38 +++ b/drivers/staging/zram/zram_drv.c
39 @@ -435,12 +435,6 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio)
40 int ret = 0;
41 struct zram *zram = queue->queuedata;
43 - if (unlikely(!zram->init_done)) {
44 - set_bit(BIO_UPTODATE, &bio->bi_flags);
45 - bio_endio(bio, 0);
46 - return 0;
47 - }
48 -
49 if (!valid_io_request(zram, bio)) {
50 zram_stat64_inc(zram, &zram->stats.invalid_io);
51 bio_io_error(bio);
52 --
53 1.6.6.1