From: Christoph Hellwig <hch@infradead.org>
To: Stefan Haberland <sth@linux.vnet.ibm.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, hoeppner@linux.vnet.ibm.com,
sebott@linux.vnet.ibm.com
Subject: Re: [RFC] block: check partition alignment
Date: Wed, 14 Dec 2016 09:07:19 -0800 [thread overview]
Message-ID: <20161214170719.GA3599@infradead.org> (raw)
In-Reply-To: <20161214164706.45543-1-sth@linux.vnet.ibm.com>
> To prevent partitions that are not aligned to the physical blocksize
> of a device check for the alignment in the blkpg_ioctl.
We'd also need to reject this when reading partitions from disk, right?
> + /* check if partition is aligned to blocksize */
> + if (p.start % bdev_physical_block_size(bdev) != 0)
And this should be bdev_logical_block_size, as the logical block size
is the only thing that matters for the OS - exposing the physical block
size is just an optional hint to prevent users from doing stupid
things (like creating unaligned partitions :))
next prev parent reply other threads:[~2016-12-14 17:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 16:47 [RFC] block: check partition alignment Stefan Haberland
2016-12-14 17:07 ` Christoph Hellwig [this message]
2016-12-15 1:33 ` Damien Le Moal
2016-12-15 8:45 ` Christoph Hellwig
2016-12-15 8:56 ` Damien Le Moal
2016-12-19 16:15 ` Stefan Haberland
2016-12-19 16:15 ` [v2] " Stefan Haberland
2016-12-19 16:18 ` Christoph Hellwig
2016-12-15 0:29 ` [RFC] " Damien Le Moal
2016-12-15 0:55 ` Damien Le Moal
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=20161214170719.GA3599@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=hoeppner@linux.vnet.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebott@linux.vnet.ibm.com \
--cc=sth@linux.vnet.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox