From: Ric Wheeler <rwheeler@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Niels de Vos <ndevos@redhat.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Al Viro <viro@zeniv.linux.org.uk>, Jeff Moyer <jmoyer@redhat.com>,
"Bryn M. Reeves" <bmr@redhat.com>
Subject: Re: [PATCH v3] fs: Invalidate the cache for a parent block-device if fsync() is called for a partition
Date: Fri, 27 Jan 2012 07:19:44 -0500 [thread overview]
Message-ID: <4F229660.4000708@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1201261646570.28710@hs20-bc2-1.build.redhat.com>
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
next prev parent reply other threads:[~2012-01-27 12:19 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-20 1:58 [PATCH] block: Invalidate the cache for a parent block-device Mikulas Patocka
2012-01-20 9:35 ` Niels de Vos
2012-01-23 10:38 ` [PATCH v2] fs: Invalidate the cache for a parent block-device if fsync() is called for a partition Niels de Vos
2012-01-23 16:27 ` Jeff Moyer
2012-01-23 16:46 ` Niels de Vos
2012-01-23 19:23 ` Mikulas Patocka
2012-01-23 20:04 ` Jeff Moyer
2012-01-26 10:03 ` Andrew Morton
2012-01-26 11:50 ` Niels de Vos
2012-01-26 13:33 ` [PATCH v3] " Niels de Vos
2012-01-26 21:40 ` Andrew Morton
2012-01-26 21:45 ` Christoph Hellwig
2012-01-26 21:50 ` Mikulas Patocka
2012-01-27 12:19 ` Ric Wheeler [this message]
2012-01-31 16:00 ` Niels de Vos
2012-01-31 18:58 ` Andrew Morton
2012-01-31 19:04 ` Christoph Hellwig
2012-01-31 19:32 ` Andrew Morton
2012-01-31 19:37 ` Christoph Hellwig
2012-01-31 19:48 ` Andrew Morton
2012-01-26 21:49 ` Jeff Moyer
2012-01-26 22:13 ` Mikulas Patocka
2012-01-26 22:26 ` Kernel Oops report (Android gingerbread) Fan Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F229660.4000708@redhat.com \
--to=rwheeler@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bmr@redhat.com \
--cc=hch@infradead.org \
--cc=jmoyer@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=ndevos@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.