From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IXpPZ-0007x7-60 for mharc-grub-devel@gnu.org; Tue, 18 Sep 2007 22:35:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IXpPX-0007wQ-Kk for grub-devel@gnu.org; Tue, 18 Sep 2007 22:35:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IXpPW-0007vh-3g for grub-devel@gnu.org; Tue, 18 Sep 2007 22:35:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IXpPW-0007vX-0w for grub-devel@gnu.org; Tue, 18 Sep 2007 22:35:30 -0400 Received: from mx07.ms.so-net.ne.jp ([202.238.82.7]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1IXpPV-0008LW-DS for grub-devel@gnu.org; Tue, 18 Sep 2007 22:35:29 -0400 Received: from temjin (pddf8e5.gifunt01.ap.so-net.ne.jp [218.221.248.229]) by mx07.ms.so-net.ne.jp with ESMTP id l8J2ZHix004399 for ; Wed, 19 Sep 2007 11:35:18 +0900 (JST) From: "Hitoshi Ozeki" To: "'The development of GRUB 2'" Date: Wed, 19 Sep 2007 11:35:10 +0900 Keywords: =?us-ascii?B?ZkFmQ2ZmZkEvZnFmImZn?= Message-ID: <000001c7fa65$b370bf20$030010ac@temjin> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6822 Importance: Normal Thread-Index: Acfua/YItBG+KHtlSpCLMUUeKOuA+wL9LDpg In-Reply-To: <200709032249.26299.okuji@enbug.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Detected-Kernel: Solaris 9.1 Subject: RE: GRUB 1.95 cannot read the ufs filesystem X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2007 02:35:31 -0000 Hello. On 17 April 2007, I wrote: --- begin grub-1.95/fs/ufs.c ---------------------------------- static struct grub_fs grub_ufs_fs = { .name = "ufs", .dir = grub_ufs_dir, .open = grub_ufs_open, .read = grub_ufs_read, .close = grub_ufs_close, .label = grub_ufs_label, .next = 0 }; --- end grub-1.95/fs/ufs.c ------------------------------------ The '.label' should set to 0. On 4 September 2007, Okuji wrote: but I think UFS2 supports a volume name. This source is function "grub_normal_print_device_info()" of the "grub-1.95/normal/misc.c". --- begin grub-1.95/normal/misc.c ----------------------------- dev = grub_device_open (name); if (! dev) grub_printf ("Filesystem cannot be accessed"); else if (! dev->disk || ! dev->disk->has_partitions || dev->disk->partition) { char *label; grub_fs_t fs; fs = grub_fs_probe (dev); /* Ignore all errors. */ grub_errno = 0; grub_printf ("Filesystem type %s", fs ? fs->name : "unknown"); if (fs && fs->label) { (fs->label) (dev, &label); <---- We expect that C string will be set as a 'label.' if (grub_errno == GRUB_ERR_NONE) { if (label && grub_strlen (label)) <--- ouch! 'label' is not C string. grub_printf (", Label %s", label); grub_free (label); <--- gaaaaah! } grub_errno = GRUB_ERR_NONE; } --- end grub-1.95/normal/misc.c ------------------------------- In ufs.c, "label" function does nothing. but, In "normal/misc.c" expects that "ufs.c" allocates a memory and terminates with NIL. Even if we did not have any return value in the "label" function, it is not good to do nothing. static grub_err_t grub_ufs_label (grub_device_t device __attribute ((unused)), char **label) { *label = grub_malloc (1); **label = '\0'; return GRUB_ERR_NONE; } -- Regards, Hitoshi Ozeki