Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932658AbYCEL71 (ORCPT ); Wed, 5 Mar 2008 06:59:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764996AbYCEL5Z (ORCPT ); Wed, 5 Mar 2008 06:57:25 -0500 Received: from mtagate2.de.ibm.com ([195.212.29.151]:2776 "EHLO mtagate2.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761732AbYCEL5U (ORCPT ); Wed, 5 Mar 2008 06:57:20 -0500 Message-Id: <20080305115714.023087298@de.ibm.com> References: <20080305115432.691030908@de.ibm.com> User-Agent: quilt/0.46-1 Date: Wed, 05 Mar 2008 12:54:37 +0100 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Stefan Weinhuber , Martin Schwidefsky Subject: [patch 05/10] dasd: fix reference counting in display method for proc/dasd/devices Content-Disposition: inline; filename=005-dasd-refcount.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1382 Lines: 43 From: Stefan Weinhuber Using the /proc/dasd/devices interface leaves the reference counter of alias devices in an inconsistent state. A process that tries to set such a device offline afterwards will hang. The dasd_devices_show function returns immediately for alias devices and this code path was missing a dasd_put_device call. Signed-off-by: Stefan Weinhuber Signed-off-by: Martin Schwidefsky --- drivers/s390/block/dasd_proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: quilt-2.6/drivers/s390/block/dasd_proc.c =================================================================== --- quilt-2.6.orig/drivers/s390/block/dasd_proc.c +++ quilt-2.6/drivers/s390/block/dasd_proc.c @@ -62,8 +62,10 @@ dasd_devices_show(struct seq_file *m, vo return 0; if (device->block) block = device->block; - else + else { + dasd_put_device(device); return 0; + } /* Print device number. */ seq_printf(m, "%s", device->cdev->dev.bus_id); /* Print discipline string. */ -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/