public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Carlos Maiolino <cmaiolino@redhat.com>, xfs@oss.sgi.com
Subject: Re: [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size
Date: Mon, 28 Nov 2011 10:11:40 -0600	[thread overview]
Message-ID: <4ED3B2BC.1060609@sandeen.net> (raw)
In-Reply-To: <yq1vcq4grgi.fsf@sermon.lab.mkp.net>

On 11/28/11 10:08 AM, Martin K. Petersen wrote:
>>>>>> "Dave" == Dave Chinner <david@fromorbit.com> writes:
> 
>>> Ok, if we have mismanaged the alignment and aligned to logical, not
>>> physical, then I guess there would be an issue... but at that point
>>> we've already messed up (though not catastrophically I guess)...
> 
> Dave> That's where I'm concerned - if alignment is screwed because the
> Dave> FS is 512B sector aligned (because something read the logical
> Dave> sector size), then using a 4k sector will result in torn writes
> Dave> because every 4k sector write is potentially made up of 2 4k write
> Dave> IOs, not 1.
> 
> There's another inherent failure scenario with 512b logical / 4096b
> physical. If you write in 512-byte multiples and experience a medium
> error you can lose the sibling logical blocks within that physical
> block. You'll get an I/O error back but there are no means to
> communicate that you have also lost blocks that were not part of your
> write request. So if you use 512-byte entries in the journal and get a
> write error you should at the very minimum consider adjacent entries
> inside a 4KB window suspect.
> 
> 
> Dave> That's my concern - using the logical 512b sector size is -always-
> Dave> safe, but using the 4k physical block size is only safe if
> Dave> everything under the filesystem has detected and used the physical
> Dave> block size of the disk for alignment and sector sizes...
> 
> You should always take alignment into account.
> 
> And while Christoph is right that (thankfully) nobody ended up shipping
> drives with 1-alignment by default, most 512e drives have the alignment
> jumper and some people actually use it.

It seems that we should be checking for any alignment offsets in libxfs
then, too; if there IS an offset, then perhaps 4k is the wrong answer,
(perhaps there is no right answer) but if there is NO offset, 4k should
be the right choice, yes?

And if the drive is broken then c'est la vie?

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2011-11-28 16:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 19:20 [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size Carlos Maiolino
2011-11-24 19:50 ` Carlos Maiolino
2011-11-27  1:06   ` Dave Chinner
2011-11-27 23:05     ` Eric Sandeen
2011-11-27 23:50       ` Dave Chinner
2011-11-28  7:56         ` Christoph Hellwig
2011-11-28 16:08         ` Martin K. Petersen
2011-11-28 16:11           ` Eric Sandeen [this message]
2011-11-29 17:15             ` Martin K. Petersen
2011-11-29 17:38               ` Eric Sandeen
2011-11-30  0:19                 ` Dave Chinner
2011-11-30 15:03                   ` Carlos Maiolino
2011-11-28 16:56           ` Greg Freemyer
2011-11-28  7:54       ` Christoph Hellwig

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=4ED3B2BC.1060609@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=cmaiolino@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=xfs@oss.sgi.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