All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 2/4] dm-log: update resume method for interruption of presuspend
@ 2010-02-23 18:45 ` Takahiro Yasui
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Yasui @ 2010-02-23 18:45 UTC (permalink / raw)
  To: device-mapper development; +Cc: k-ueda, LVM2 development

When suspend is interrupted after presuspend procedure, each
target needs to cancel all state changes done by its presuspend
procedure. As for the log target, there is nothing to be canceled
because the log target doesn't have a presuspend method.

The log target should skip disk_resume/core_resume method when
the target isn't suspended.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 drivers/md/dm-log.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: linux-2.6.33-rc1-dm/drivers/md/dm-log.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-log.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-log.c
@@ -593,6 +593,10 @@ static int disk_resume(struct dm_dirty_l
 	struct log_c *lc = (struct log_c *) log->context;
 	size_t size = lc->bitset_uint32_count * sizeof(uint32_t);
 
+	/* Just returns if the state is not "suspended." */
+	if (!dm_suspended(lc->ti))
+		return 0;
+
 	/* read the disk header */
 	r = read_header(lc);
 	if (r) {
@@ -658,6 +662,11 @@ static uint32_t core_get_region_size(str
 static int core_resume(struct dm_dirty_log *log)
 {
 	struct log_c *lc = (struct log_c *) log->context;
+
+	/* Just returns if the state is not "suspended." */
+	if (!dm_suspended(lc->ti))
+		return 0;
+
 	lc->sync_search = 0;
 	return 0;
 }

--
lvm-devel mailing list
lvm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel

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

* [RFC][PATCH 2/4] dm-log: update resume method for interruption of presuspend
@ 2010-02-23 18:45 ` Takahiro Yasui
  0 siblings, 0 replies; 2+ messages in thread
From: Takahiro Yasui @ 2010-02-23 18:45 UTC (permalink / raw)
  To: lvm-devel

When suspend is interrupted after presuspend procedure, each
target needs to cancel all state changes done by its presuspend
procedure. As for the log target, there is nothing to be canceled
because the log target doesn't have a presuspend method.

The log target should skip disk_resume/core_resume method when
the target isn't suspended.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 drivers/md/dm-log.c |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: linux-2.6.33-rc1-dm/drivers/md/dm-log.c
===================================================================
--- linux-2.6.33-rc1-dm.orig/drivers/md/dm-log.c
+++ linux-2.6.33-rc1-dm/drivers/md/dm-log.c
@@ -593,6 +593,10 @@ static int disk_resume(struct dm_dirty_l
 	struct log_c *lc = (struct log_c *) log->context;
 	size_t size = lc->bitset_uint32_count * sizeof(uint32_t);
 
+	/* Just returns if the state is not "suspended." */
+	if (!dm_suspended(lc->ti))
+		return 0;
+
 	/* read the disk header */
 	r = read_header(lc);
 	if (r) {
@@ -658,6 +662,11 @@ static uint32_t core_get_region_size(str
 static int core_resume(struct dm_dirty_log *log)
 {
 	struct log_c *lc = (struct log_c *) log->context;
+
+	/* Just returns if the state is not "suspended." */
+	if (!dm_suspended(lc->ti))
+		return 0;
+
 	lc->sync_search = 0;
 	return 0;
 }



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

end of thread, other threads:[~2010-02-23 18:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-23 18:45 [RFC][PATCH 2/4] dm-log: update resume method for interruption of presuspend Takahiro Yasui
2010-02-23 18:45 ` Takahiro Yasui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.