[Top][All Lists]

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

[patch #1754] [Patch #1754] store_{read, write} abort program when LEN i

From: noreply
Subject: [patch #1754] [Patch #1754] store_{read, write} abort program when LEN is not aligned
Date: Sat, 02 Aug 2003 07:46:17 -0400
User-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

Patch #1754 has been updated. 

Category: libstore
Status: Open
Summary: store_{read,write} abort program when LEN is not aligned


Date: Wed 07/23/03 at 14:35
By: ogi

* Copyright years are updated.

Date: Thu 07/31/03 at 23:46
By: marcus

The assert is there to catch bugs in libstore using programs, which usually 
only access store blocks with aligned boundaries.

Do you have an application which doesn't do this, or did you see a Hurd program 
using libstore in a way that triggers the assertion?


Date: Fri 08/01/03 at 10:15
By: ogi

I hit this problem while patching e2fsprogs to work with libstore.  e2fsprogs 
uses some unaligned reads from block devices.

If libstore was internal library in the Hurd, I would agree with you.  But 
native Hurd programs (not in the Hurd distribution) can legally want to use the 
library, so libstore must behave correctly on invalid arguments.  For example, 
munmap returns EINVAL if address is not aligned, it doesn't throw assertion 
failure.  What is the difference between munmap and store_read so that 
store_read have to not return EINVAL on invalid arguments?

Moreover, every program that uses store_read must check if I/O errors occured.  
So the EINVAL will always be caught ;-)

Date: Fri 08/01/03 at 13:41
By: marcus

Why does e2fsprogs unaligned reads?  I would like to discuss what it does, 
independently of resolving this patch.

I agree that eventually we want to make libstore more robust  But before we can 
do that, we must check that all existing callers, at least those in the Hurd 
code, but preferably also parted etc, do check the return value properly.  Can 
you please do that?


Date: Sat 08/02/03 at 14:46
By: ogi

In e2fsprogs, the I/O function that reads data is io_channel_read_blk. It 
accepts _number of blocks_.  But if this count is negative, then its negated 
value is accepted as _number of bytes_.   For example, this is used in 
e2fsprogs/lib/ext2fs/rw_bitmaps:read_bitmaps.  Of course, this is not a problem 
when you use Unix API.

I'm willing to check all the Hurd for calls to store_read and store_write, but 
I don't know any other program, except parted, that uses libstore.  If there 
is, please tell me.

For more info, visit:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]