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

Previous thread: Problem with reiserfs in 2.6.23-mm1 by Ben on Saturday, October 20, 2007 - 7:17 am. (2 messages)

Next thread: [PATCH] x86: merge required-features.h by Brian Gerst on Saturday, October 20, 2007 - 10:41 am. (2 messages)
From: emist
Date: Saturday, October 20, 2007 - 10:24 am

Thanks Frans, I will do as you suggest.

Have a good one,

Igor H.
-

From: Heiko Carstens
Date: Sunday, October 21, 2007 - 3:09 am

Gerald or Carsten (cc'ed) should look into this.
Thanks for reporting.
-

From: emist
Date: Sunday, October 21, 2007 - 8:46 pm

Hello,

I realized that I did not fix one of the cases where this bug manifests
in my last patch. Here is the complete patch to fix the issue. And this
time I cc'ed the relevant people.

Have a good one,

Igor H.


From: Cornelia Huck
Date: Monday, October 22, 2007 - 4:37 am

On Sun, 21 Oct 2007 23:46:49 -0400,

Hm, seems we missed another of those device attributes exhibiting
suicidal tendencies...

Tejun has a patchset allowing device attributes to commit suicide (see
http://marc.info/?l=linux-kernel&m=119027371416452&w=2), although I'm
not sure what its current status is. Until then, you would need to use
device_schedule_callback() to commit suicide.

This all of course only applies if killing the segment is better than
leaving it in its current state, but others can make a better judgement
on that :)
-

From: Gerald Schaefer
Date: Tuesday, October 23, 2007 - 6:22 am

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;

-

From: emist
Date: Tuesday, October 23, 2007 - 3:03 pm

Hey,

That makes sense. I no longer have access to an s390 system so I will
not be able to provide a tested patch for this bug. I will however
attempt to fix this issue and submit a patch using the scheduled
callback function and maybe someone could make sure that it works properly.

Have a good one,

Igor H.
-

Previous thread: Problem with reiserfs in 2.6.23-mm1 by Ben on Saturday, October 20, 2007 - 7:17 am. (2 messages)

Next thread: [PATCH] x86: merge required-features.h by Brian Gerst on Saturday, October 20, 2007 - 10:41 am. (2 messages)