zram: delay pending free request in read path
authorMinchan Kim <minchan@kernel.org>
Thu, 30 Jan 2014 23:46:00 +0000 (15:46 -0800)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:18 +0000 (11:47 +0900)
commit3ea77a85038cdce72b5d278bd2ff0d8ef2173075
tree448fd82ab4441e5a95d6bcaac0dfabc3db337de9
parent28a1db0c60b6eff0daba9220e785ee1080d45764
zram: delay pending free request in read path

Sergey reported we don't need to handle pending free request every I/O
so that this patch removes it in read path while we remain it in write
path.

Let's consider below example.

Swap subsystem ask to zram "A" block free by swap_slot_free_notify but
zram had been pended it without real freeing.  Swap subsystem allocates
"A" block for new data but request pended for a long time just handled
and zram blindly free new data on the "A" block.  :(

That's why we couldn't remove handle pending free request right before
zram-write.

Change-Id: Ib4409bfad7b1ae263e2708c74875c322da72c7b3
Signed-off-by: Minchan Kim <minchan@kernel.org>
Reported-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/zram/zram_drv.c