xfs
[Top] [All Lists]

Re: [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector s

To: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
Subject: Re: [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 28 Nov 2011 10:11:40 -0600
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, Carlos Maiolino <cmaiolino@xxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <yq1vcq4grgi.fsf@xxxxxxxxxxxxxxxxxx>
References: <1322162451-17036-1-git-send-email-cmaiolino@xxxxxxxxxx> <20111124195042.GA3671@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20111127010643.GU2386@dastard> <4ED2C233.8010104@xxxxxxxxxxx> <20111127235051.GX2386@dastard> <yq1vcq4grgi.fsf@xxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0
On 11/28/11 10:08 AM, Martin K. Petersen wrote:
>>>>>> "Dave" == Dave Chinner <david@xxxxxxxxxxxxx> 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

<Prev in Thread] Current Thread [Next in Thread>