linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@linux.intel.com>
To: Boaz Harrosh <boaz@plexistor.com>
Cc: Jens Axboe <axboe@fb.com>, Dmitry Monakhov <dmonakhov@openvz.org>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 3/5] brd: Add getgeo to block ops
Date: Thu, 28 Aug 2014 11:11:26 -0400	[thread overview]
Message-ID: <20140828151126.GI3285@linux.intel.com> (raw)
In-Reply-To: <53FED9A7.3020608@plexistor.com>

On Thu, Aug 28, 2014 at 10:26:31AM +0300, Boaz Harrosh wrote:
> On 08/27/2014 08:53 PM, Matthew Wilcox wrote:
> > On Wed, Aug 27, 2014 at 06:28:25PM +0300, Boaz Harrosh wrote:
> >> We set all hd_geometry members to 1, because this way fdisk
> >> math will not try its crazy geometry math and get stuff totally wrong.
> >>
> >> I was trying to get some values that will make fdisk Want to align
> >> first sector on 4K (like 8, 16, 20, ... sectors) but nothing worked,
> >> I searched the net the math is not your regular simple multiplication
> >> at all.
> >>
> >> If you managed to get these please tell me. I would love to solve
> >> this.
> >>
> >> But for now we use 4k physical sectors for fixing fdisk alignment
> >> issues, and setting these here to something that will not make
> >> fdisk serve us with crazy numbers.
> > 
> > Are you saying that fdisk ignores the 4k physical sectors (that you set up
> > in patch 5/5) in favour of the geometry exposed here?  That doesn't make
> > sense to me, since it would misalign 4k-physical ATA drives if it did.
> > 
> 
> No with patch 5/5 the 4k stuff is good.
> 
> What I'm saying is that with (64, 32, x) fdisk offers a very high first
> sector and with all 1(s) it will allow a low value like 4k
> 
> For example with (64, 32, x) + the 4k patch in 5/5 with a 4M brd disk it
> will offer 40 (20K) as first possible sector.
> 
> With this patch applied it will offer 8 (4K) as first sector, which is what
> I want

That makes for a much better changelog entry than what you wrote above :-)

> > I don't see anywhere else in the kernel reporting (1,1,1).  The most common
> > form to fake a geometry uses (64, 32, x), including SCSI.
> >
> 
> But is it wrong? why?
> 
> I guess that until now no one cared about wasted space at the beginning
> but with brd I do. Your words this is all "fake" then why at all.
> With all 1(s) the CHS convoluted math just disappears and gets out of the
> way.

It is all fake.  Nobody's reported their real CHS geometry in twenty
years.  A drive's geometry has been more complex than a fixed number
of sectors per track, and anyway the hd_geometry struct tops out at
describing a 500GB drive (with 63 heads and 255 sectors).

My concern is that clearly (64, 32, x) works since other drivers are
doing it.  (1, 1, 1) is stepping into the unknown, and we don't know
what applications are going to make of this value.

This really needs to be something that's handled by the block midlayer.
Forcing drivers to make this stuff up is only leading to pain and
suffering.  Drivers that don't have a getgeo method should be given a
default geometry that makes all known users of getgeo do the right thing.


  reply	other threads:[~2014-08-28 15:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 15:22 [PATCHSET 0/5 v2] brd: partition fixes Boaz Harrosh
2014-08-27 15:25 ` [PATCH 1/5] axonram: Fix bug in direct_access Boaz Harrosh
2014-08-27 15:27 ` [PATCH 2/5] Change direct_access calling convention Boaz Harrosh
2014-08-27 15:28 ` [PATCH 3/5] brd: Add getgeo to block ops Boaz Harrosh
2014-08-27 17:53   ` Matthew Wilcox
2014-08-28  7:26     ` Boaz Harrosh
2014-08-28 15:11       ` Matthew Wilcox [this message]
2014-08-28 15:43         ` Boaz Harrosh
2014-08-27 15:30 ` [PATCH 4/5] brd: Fix all partitions BUGs Boaz Harrosh
2014-08-27 15:32 ` [PATCH 5/5] brd: Request from fdisk 4k alignment Boaz Harrosh
2014-08-27 15:45 ` [PATCHSET 0/5 v2] brd: partition fixes Dmitry Monakhov
2014-08-27 15:57   ` Boaz Harrosh
2014-09-01 10:15 ` Boaz Harrosh
2014-09-09 12:10   ` Boaz Harrosh
2014-09-09 14:25     ` Jens Axboe
2014-09-28 10:45       ` Boaz Harrosh
2014-10-19 17:46       ` Boaz Harrosh
2014-11-04 16:17         ` Boaz Harrosh
2014-11-05  0:50           ` Jens Axboe

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=20140828151126.GI3285@linux.intel.com \
    --to=willy@linux.intel.com \
    --cc=axboe@fb.com \
    --cc=boaz@plexistor.com \
    --cc=dmonakhov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ross.zwisler@linux.intel.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;
as well as URLs for NNTP newsgroup(s).