All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Eric Sandeen <sandeen@sandeen.net>,
	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 11:08:29 -0500	[thread overview]
Message-ID: <yq1vcq4grgi.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <20111127235051.GX2386@dastard> (Dave Chinner's message of "Mon, 28 Nov 2011 10:50:51 +1100")

>>>>> "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.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

  parent reply	other threads:[~2011-11-28 16:09 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 [this message]
2011-11-28 16:11           ` Eric Sandeen
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=yq1vcq4grgi.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=cmaiolino@redhat.com \
    --cc=david@fromorbit.com \
    --cc=sandeen@sandeen.net \
    --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 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.