lkml.org 
[lkml]   [2010]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Fix reset of ramzswap
From
Date
ioctl(cmd=reset)
-> bd_holder check (if whoever hold bdev, return -EBUSY)
-> ramzswap_ioctl_reset_device
-> reset_device
-> bd_release

bd_release is called by reset_device.
but ramzswap_ioctl always checks bd_holder before
reset_device. it means reset ioctl always fails.

This patch fixes it.

This patch is based on mmotm-2010-01-06-14-34 +
[PATCH] Free memory when create_device is failed.

Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
---
drivers/staging/ramzswap/ramzswap_drv.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
index 18196f3..42531bd 100644
--- a/drivers/staging/ramzswap/ramzswap_drv.c
+++ b/drivers/staging/ramzswap/ramzswap_drv.c
@@ -1270,11 +1270,6 @@ static int ramzswap_ioctl(struct block_device *bdev, fmode_t mode,
break;

case RZSIO_RESET:
- /* Do not reset an active device! */
- if (bdev->bd_holders) {
- ret = -EBUSY;
- goto out;
- }
ret = ramzswap_ioctl_reset_device(rzs);
break;

--
1.5.6.3

--
Kind regards,
Minchan Kim



\
 
 \ /
  Last update: 2010-01-12 06:01    [W:0.042 / U:7.324 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site