mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Boaz Harrosh <boaz@plexistor.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	Ross Zwisler <ross.zwisler@linux.intel.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 2/4 v2] brd: Add getgeo to block ops
Date: Thu, 7 Aug 2014 19:20:32 +0100	[thread overview]
Message-ID: <20140807192032.70e71fa7@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <53E3871C.4020008@plexistor.com>

On Thu, 07 Aug 2014 17:03:08 +0300
Boaz Harrosh <boaz@plexistor.com> wrote:

> From: Boaz Harrosh <boaz@plexistor.com>
> 
> Some programs like fdisk, require HDIO_GETGEO to work, which requires we
> implement getgeo.
> 
> 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.

If you are running a new storage system for god sake don't use DOS
partitioning, use GPT or something sane.

> +static int brd_getgeo(struct block_device *bd, struct hd_geometry *geo)
> +{
> +	/* Just tell fdisk to get out of the way. The math here is so
> +	 * convoluted and does not make any sense at all. With all 1s
> +	 * The math just gets out of the way.
> +	 * NOTE: 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
> +	 * fix here. For now we use 4k physical sectors for this
> +	 */
> +	geo->heads = 1;
> +	geo->sectors = 1;
> +	geo->cylinders = 1;
> +	return 0;

This is then going to blow up on your with some other tool. Fix fdisk
instead. Lying to apps generally ends up like children lying to parents -
the lie gets more complicated to keep up each case you find until it
breaks.

Alan

  reply	other threads:[~2014-08-07 18:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 11:27 [PATCHSET 0/4] brd: partition fixes Boaz Harrosh
2014-08-06 11:29 ` [PATCH 1/4] Change direct_access calling convention Boaz Harrosh
2014-08-06 11:30 ` [PATCH 2/4] brd: Add getgeo to block ops Boaz Harrosh
2014-08-06 17:52   ` Ross Zwisler
2014-08-07  9:20     ` Boaz Harrosh
2014-08-07 14:03   ` [PATCH 2/4 v2] " Boaz Harrosh
2014-08-07 18:20     ` One Thousand Gnomes [this message]
2014-08-08  6:52       ` Boaz Harrosh
2014-08-08  6:58         ` Davidlohr Bueso
2014-08-06 11:33 ` [PATCH 3/4] brd: Fix all partitions BUGs Boaz Harrosh
2014-08-06 23:06   ` Ross Zwisler
2014-08-07  9:11     ` Boaz Harrosh
2014-08-07 18:50       ` Ross Zwisler
2014-08-07 18:53   ` Ross Zwisler
2014-08-06 11:35 ` [PATCH 4/4] brd: Request from fdisk 4k alignment Boaz Harrosh
2014-08-06 22:03   ` Ross Zwisler
2014-08-07 12:17     ` Boaz Harrosh
2014-08-07 13:00       ` Karel Zak
2014-08-07 13:51         ` Karel Zak
2014-08-07 13:57         ` Boaz Harrosh
2014-08-07 15:21           ` Karel Zak
2014-08-07 15:40             ` Boaz Harrosh

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=20140807192032.70e71fa7@alan.etchedpixels.co.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=axboe@kernel.dk \
    --cc=boaz@plexistor.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=willy@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

Powered by JetHome