From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: emist <emistz@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>,
Linux <linux-kernel@vger.kernel.org>,
geraldsc@de.ibm.com, cotte@de.ibm.com, linux390@de.ibm.com,
linux-s390@vger.kernel.org, Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH] Bug fix for the s390 dcssblk driver
Date: Tue, 23 Oct 2007 15:22:54 +0200 [thread overview]
Message-ID: <1193145774.5325.27.camel@localhost.localdomain> (raw)
In-Reply-To: <20071022133723.089b84db@gondolin.boeblingen.de.ibm.com>
On Mon, 2007-10-22 at 13:37 +0200, Cornelia Huck wrote:
> On Sun, 21 Oct 2007 23:46:49 -0400,
> emist <emistz@gmail.com> wrote:
>
> > # This patch fixes a memory corruption bug in the s390 dcssblk driver.
> > # The bug occurs when an attempt to change the type of a segment
> > # returns an error. At this point the driver tries to remove the segment in
> > # question while some of the device's attributes are in use. This causes the
> > # driver to hang.
>
> 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 :)
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;
next prev parent reply other threads:[~2007-10-23 13:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200710201451.57138.elendil@planet.nl>
2007-10-20 17:24 ` [PATCH] Bug fix for the s390 dcssblk driver emist
2007-10-21 10:09 ` Heiko Carstens
2007-10-22 3:46 ` emist
2007-10-22 11:37 ` Cornelia Huck
2007-10-23 13:22 ` Gerald Schaefer [this message]
2007-10-23 22:03 ` emist
2007-10-20 5:07 emist
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1193145774.5325.27.camel@localhost.localdomain \
--to=gerald.schaefer@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=emistz@gmail.com \
--cc=geraldsc@de.ibm.com \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux390@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox