From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U65fl-0000qn-7Y for mharc-grub-devel@gnu.org; Thu, 14 Feb 2013 15:44:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U65fc-0000on-E1 for grub-devel@gnu.org; Thu, 14 Feb 2013 15:44:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U65fT-0005Km-Cz for grub-devel@gnu.org; Thu, 14 Feb 2013 15:44:40 -0500 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:59013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U65fT-0005Ki-8w for grub-devel@gnu.org; Thu, 14 Feb 2013 15:44:31 -0500 X-Authority-Analysis: v=2.0 cv=K++g7lqI c=1 sm=0 a=/DbS/tiKggfTkRRHPZEB4g==:17 a=Qsx_du5GiBkA:10 a=qvxnG7FKX0EA:10 a=S1A5HrydsesA:10 a=IkcTkHD0fZMA:10 a=fxJcL_dCAAAA:8 a=QfKxxUxMAAAA:8 a=Rq-qZmC-KfN4dG1eitgA:9 a=QEXdDO2ut3YA:10 a=/DbS/tiKggfTkRRHPZEB4g==:117 X-Cloudmark-Score: 0 X-Authenticated-User: X-Originating-IP: 67.78.168.186 Received: from [67.78.168.186] ([67.78.168.186:50127] helo=[10.1.1.235]) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 05/7D-25866-EAC4D115; Thu, 14 Feb 2013 20:44:30 +0000 Message-ID: <511D4CAE.1060403@ubuntu.com> Date: Thu, 14 Feb 2013 15:44:30 -0500 From: Phillip Susi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: O_SYNC References: <511CFD54.1050401@ubuntu.com> <511D073D.2040005@gmail.com> In-Reply-To: <511D073D.2040005@gmail.com> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 75.180.132.120 Cc: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2013 20:44:47 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 While playing around with fully featured images, I noticed that grub-setup takes ages to write the image to disk. It seems that this is because the disk is opened with O_SYNC, and sectors are written one at a time. This is terribly silly, so I was going to submit a patch removing the flag, but I noticed that the flush code that should fsync after writing the whole image is not actually being called. I traced it down to here: grub_err_t grub_util_biosdisk_flush (struct grub_disk *disk) { struct grub_util_biosdisk_data *data = disk->data; if (disk->dev->id != GRUB_DISK_DEVICE_BIOSDISK_ID) => return GRUB_ERR_NONE; It seems the id is GRUB_DISK_DEVICE_HOSTDISK_ID. What is the intention of this check and why is it skipping the fsync? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRHUyuAAoJEJrBOlT6nu754CEH/19lSCLHRqQlGpqGDdjWvlRS R2uGCLdHEdfn/8+Upm4PrkWn5LH0TYTDLHDtPEhnMxbe0TfpV17KovqATwLrjVJi k13J4JY8lhmou0JKzFx3/lP9nWcM/4GGB1nowf3VxMnfFkJqYSBiKNbL9WuJCnaV HQgLXwRqbi2EeBUe99HM+0TRbiOoZF0umtjAVX+Wa9OikFofoTpVf+bu0eA6ysZ3 jSgjXTVmdVT/FQzUtRA0vIieqabRe7PJZv1ilNxLCUoYcK6LfMpw72jbZ3lQlMRe kku4hnx4ZjZFv38qNdLMrr5B3D48P7+PQe+FFV04sIocsp0FidrT3mUOb/RO1Gw= =XiGl -----END PGP SIGNATURE-----