Re: [PATCH] Bug fix for the s390 dcssblk driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gerald Schaefer
Date: Tuesday, October 23, 2007 - 6:22 am

On Mon, 2007-10-22 at 13:37 +0200, Cornelia Huck wrote:

Hi,

thanks for reporting this bug, seems like we forgot to consider the
suicidal behavior of this driver when the device_unregister() stuff was
changed.

The best solution for now would be to use the scheduled callback
function, like Cornelia described. If segment_modify_shared() should
fail, the DCSS segment will be unloaded. Calling the function again
with the old "shared" flag will not help because it will not reload
the segment. So we need to remove/unregister the device in this error
path, and for now this should be done with device_schedule_callback().

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
---

 dcssblk.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

Index: linux-2.6.23/drivers/s390/block/dcssblk.c
===================================================================
--- linux-2.6.23.orig/drivers/s390/block/dcssblk.c
+++ linux-2.6.23/drivers/s390/block/dcssblk.c
@@ -193,6 +193,12 @@ dcssblk_segment_warn(int rc, char* seg_n
        }
 }

+static void dcssblk_unregister_callback(struct device *dev)
+{
+       device_unregister(dev);
+       put_device(dev);
+}
+
 /*
  * device attribute for switching shared/nonshared (exclusive)
  * operation (show + store)
@@ -276,8 +282,7 @@ removeseg:
        blk_cleanup_queue(dev_info->dcssblk_queue);
        dev_info->gd->queue = NULL;
        put_disk(dev_info->gd);
-       device_unregister(dev);
-       put_device(dev);
+       rc = device_schedule_callback(dev, dcssblk_unregister_callback);
 out:
        up_write(&dcssblk_devices_sem);
        return rc;

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Bug fix for the s390 dcssblk driver, Heiko Carstens, (Sun Oct 21, 3:09 am)
Re: [PATCH] Bug fix for the s390 dcssblk driver, Cornelia Huck, (Mon Oct 22, 4:37 am)
Re: [PATCH] Bug fix for the s390 dcssblk driver, Gerald Schaefer, (Tue Oct 23, 6:22 am)