linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix reset of ramzswap
@ 2010-01-12  4:36 minchan.kim
  2010-01-12  5:30 ` Nitin Gupta
  0 siblings, 1 reply; 4+ messages in thread
From: minchan.kim @ 2010-01-12  4:36 UTC (permalink / raw)
  To: Greg KH, Nitin Gupta; +Cc: LKML, linux-mm

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-12  6:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12  4:36 [PATCH] Fix reset of ramzswap minchan.kim
2010-01-12  5:30 ` Nitin Gupta
2010-01-12  5:48   ` Minchan Kim
2010-01-12  6:48     ` Nitin Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).