[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#605759: [s390/hercules] disk partitioning failed: no /dev/dsda1



retitle 605759 [s390] parted: does not re-read DASD partition table, breaks d-i
reassign 605759 parted 2.3-4
severity 605759 serious
tags 605759 = d-i patch fixed-upstream
thanks

On Fri, Dec 17, 2010 at 08:04:39PM +0100, Ferenc Wagner wrote:
> Niko Tyni <ntyni@debian.org> writes:
> > On Thu, Dec 16, 2010 at 05:37:55PM +0100, Ferenc Wagner wrote:
> >> Niko Tyni <ntyni@debian.org> writes:
> >> 
> >>> Hercules s390 emulator installation failed at disk partitioning;
> >>> new partitions don't seem to show up in /dev.

> > It works fine if I create the partition manually with fdasd.

> > Furthermore, if I try to create a partition first with the d-i interface
> > (getting the error) and then invoke fdasd and write out a trivial no-op
> > such as change the volume serial from LIN120 to LIN120, /dev/dasda1
> > appears.

> > It looks to me like the problem is that d-i does not manage to reread
> > the partition table.

> > I'm not sure if I understand the architecture correctly here, but
> > maybe the problem is this change in parted 2.3 ?
> >
> >         libparted: remove now-worse-than-useless _kernel_reread_part_table
> >         Now that we're using BLKPG properly, there's no point in using the
> >         less-functional BLKRRPART ioctl to make the kernel reread the partition
> >         table.
> >         More importantly, this function would fail when any partition is in
> >         use, in spite of our having carefully vetted them via BLKPG ioctls.
> >
> > I see fdasd (as of s390-tools 1.8.3-3) uses BLKRRPART and not BLKPG.
> >
> > The timeline would also fit the successful reports #569209 and #575682.
> 
> This looks a fairly plausible theory, and the outcome is even more
> interesting, search for DASD in git log libparted/arch/linux.c.  As I
> understand it, 9fa0e180 may even fix this problem.

Thanks! The patch applies cleanly to 2.3-4, and I can confirm that the
it fixes the issue completely for me.

(For the sake of completeness: I built the modified parted on zelenka.d.o
 without the build dependencies libblkid-dev and check. They don't seem
 to matter in this case.)

I'm attaching the patch for convenience and reassigning this to parted.
Setting the severity to 'serious' as it looks like this breaks d-i on
s390 for everybody and not just hercules users.

Parted maintainers: feel free to downgrade if this is inflated, and
please let me know if I can help further in any way.
-- 
Niko Tyni   ntyni@debian.org
>From 9fa0e1800db5b9f094ae481fd95a51da03f19e95 Mon Sep 17 00:00:00 2001
From: Brian C. Lane <bcl@redhat.com>
Date: Mon, 22 Nov 2010 10:01:56 +0100
Subject: [PATCH] linux: remove DASD restriction on _disk_sync_part_table

* libparted/arch/linux.c: Include <assert.h>.
(linux_disk_commit): Assert that _have_blkpg returns true
and don't skip _disk_sync_part_table for DASD devices.
Otherwise, when creating a partition on a DASD device,
new /dev/*[12...] device files would not be created.
Also, remove obsolete comment about DevFS.
For details, see http://bugzilla.redhat.com/651478
and http://thread.gmane.org/gmane.comp.gnu.parted.bugs/10191
---
 libparted/arch/linux.c |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index a5ae10c..4e61bfe 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -40,6 +40,7 @@
 #include <sys/types.h>
 #include <sys/utsname.h>        /* for uname() */
 #include <scsi/scsi.h>
+#include <assert.h>
 #ifdef ENABLE_DEVICE_MAPPER
 #include <libdevmapper.h>
 #endif
@@ -2824,20 +2825,15 @@ linux_disk_commit (PedDisk* disk)
                 return _dm_reread_part_table (disk);
 #endif
         if (disk->dev->type != PED_DEVICE_FILE) {
-                /* The ioctl() command BLKPG_ADD_PARTITION does not notify
-                 * the devfs system; consequently, /proc/partitions will not
-                 * be up to date, and the proper links in /dev are not
-                 * created.  Therefore, if using DevFS, we must get the kernel
-                 * to re-read and grok the partition table.
-                 */
-                /* Work around kernel dasd problem so we really do BLKRRPART */
-		int ok = 1;
-		if (disk->dev->type != PED_DEVICE_DASD && _have_blkpg ()) {
-			if (!_disk_sync_part_table (disk))
-			  ok = 0;
-		}
 
-                return ok;
+		/* We now require BLKPG support.  If this assertion fails,
+		   please write to the mailing list describing your system.
+		   Assuming it's never triggered, ...
+		   FIXME: remove this assertion in 2012.  */
+		assert (_have_blkpg ());
+
+		if (!_disk_sync_part_table (disk))
+			return 0;
         }
 
         return 1;
-- 
1.7.2.3


Reply to: