[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F229660.4000708@redhat.com>
Date: Fri, 27 Jan 2012 07:19:44 -0500
From: Ric Wheeler <rwheeler@...hat.com>
To: Mikulas Patocka <mpatocka@...hat.com>
CC: Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Niels de Vos <ndevos@...hat.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Al Viro <viro@...iv.linux.org.uk>,
Jeff Moyer <jmoyer@...hat.com>,
"Bryn M. Reeves" <bmr@...hat.com>
Subject: Re: [PATCH v3] fs: Invalidate the cache for a parent block-device
if fsync() is called for a partition
On 01/26/2012 04:50 PM, Mikulas Patocka wrote:
>
> On Thu, 26 Jan 2012, Christoph Hellwig wrote:
>
>> On Thu, Jan 26, 2012 at 01:40:51PM -0800, Andrew Morton wrote:
>>> The Right Thing To Do here is to make the kernel behave logically and
>>> predictably, then modify the userspace tools. But if we're modifying
>>> the userspace tools then we would just change userspace to issue a
>>> BLKFLSBUF to /dev/sda and leave the kernel alone.
>> The right fix is to make partition and whole disk access coherent,
>> which is fairly simply:
>>
>> - create the block device inode/mapping per gendisk, and only reference
>> count it per block_device
>> - make sure blkdev_get_block(s) applies the correct offset if used on
>> partitions
> ... and what if you use 4kB blocksize and the partition start is not
> aligned on 4kB? (quite common case, because partitions are often aligned
> on 63 sectors) Then, you can't translate partition block numbers into disk
> block numbers.
>
> Mikulas
>
In your specific example, you cannot start a partition on a non-full block
address since you cannot address it. Either the device uses 512 byte sectors,
emulates 512 byte sectors or supports only 4096 byte sectors. In the first two
case, not an issue.
In the last case, still not an issue. If you send an unaligned IO down to a 4096
byte device, you get an IO error.
Also note that all (most?) user space tools have been fixed upstream (and in
distros) to align properly when the device exports its block size. The new
default alignment is 1MB from the start of disk, this should not be a concern.
Thanks!
Ric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists