daily pastebin goal
61%
SHARE
TWEET

[PATCH] zram: fix data corruption issue (for 2.6.37-plus_v14_kztram_coordinate-flush_inode-integrity)

a guest Feb 5th, 2011 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -Nrupad linux-2.6.37_plus_v14_bak_2//drivers/staging/zram/zram_drv.c linux-2.6.37_plus_v14_bak/drivers/staging/zram/zram_drv.c
  2. --- linux-2.6.37_plus_v14_bak_2//drivers/staging/zram/zram_drv.c        2011-02-06 03:02:18.408979967 +0100
  3. +++ linux-2.6.37_plus_v14_bak/drivers/staging/zram/zram_drv.c   2011-02-06 03:09:24.775979622 +0100
  4. @@ -231,6 +231,7 @@ static int zram_read(struct zram *zram,
  5.  
  6.                 if (zram_test_flag(zram, index, ZRAM_ZERO)) {
  7.                         handle_zero_page(page);
  8. +                       index++;
  9.                         continue;
  10.                 }
  11.  
  12. @@ -239,12 +240,14 @@ static int zram_read(struct zram *zram,
  13.                         pr_debug("Read before write: sector=%lu, size=%u",
  14.                                 (ulong)(bio->bi_sector), bio->bi_size);
  15.                         handle_zero_page(page);
  16. +                       index++;                       
  17.                         continue;
  18.                 }
  19.  
  20.                 /* Page is stored uncompressed since it's incompressible */
  21.                 if (unlikely(zram_test_flag(zram, index, ZRAM_UNCOMPRESSED))) {
  22.                         handle_uncompressed_page(zram, page, index);
  23. +                       index++;                       
  24.                         continue;
  25.                 }
  26.  
  27. @@ -324,6 +327,7 @@ static int zram_write(struct zram *zram,
  28.                         mutex_unlock(&zram->lock);
  29.                         zram_stat_inc(&zram->stats.pages_zero);
  30.                         zram_set_flag(zram, index, ZRAM_ZERO);
  31. +                       index++;
  32.                         continue;
  33.                 }
RAW Paste Data
Top