Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 874e3cdd authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds
Browse files

zram: remove unnecessary free



Commit a0c516cb ("zram: don't grab mutex in zram_slot_free_noity")
introduced pending zram slot free in zram's write path in case of
missing slot free by memory allocation failure in zram_slot_free_notify
but it is not necessary because we have already freed the slot right
before overwriting.

Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Tested-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9b353db1
Loading
Loading
Loading
Loading
+0 −8
Original line number Original line Diff line number Diff line
@@ -441,14 +441,6 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
		goto out;
		goto out;
	}
	}


	/*
	 * zram_slot_free_notify could miss free so that let's
	 * double check.
	 */
	if (unlikely(meta->table[index].handle ||
			zram_test_flag(meta, index, ZRAM_ZERO)))
		zram_free_page(zram, index);

	ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
	ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
			       meta->compress_workmem);
			       meta->compress_workmem);