[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] libxfs: Get Physical Sector Size instead of Logical Sector size
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 28 Nov 2011 02:56:47 -0500
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>, Carlos Maiolino <cmaiolino@xxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20111127235051.GX2386@dastard>
References: <1322162451-17036-1-git-send-email-cmaiolino@xxxxxxxxxx> <20111124195042.GA3671@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20111127010643.GU2386@dastard> <4ED2C233.8010104@xxxxxxxxxxx> <20111127235051.GX2386@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Nov 28, 2011 at 10:50:51AM +1100, Dave Chinner wrote:
> > I had the expectation that physical block size WAS the fundamental/atomic
> > IO size for the disk, and anything smaller required read/modify/write.
> > So I made this suggestion (and I think hch concurred) so that we weren't
> > doing log IOs which required RMW & translation.
> A RMW cycle does not mean the IO is not atomic. The write to disk
> will still be atomic, regardless of the read that ovvurred before.

I would not trust ATA disk to get this right generally.

> > 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)...
> That's where I'm concerned - if alignment is screwed because the FS
> is 512B sector aligned (because something read the logical sector size),
> then using a 4k sector will result in torn writes because every 4k
> sector write is potentially made up of 2 4k write IOs, not 1.

Disks that implement the ATA level required to tell us about the
physical blocksize also have the alignment offset information in the
IDENTIFY data to tell us about aligned shifts.  But I haven't seen a
single one with a non-zero aligned offset in the wild.

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