From: Dave Chinner <david@fromorbit.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org,
snitzer@redhat.com, hare@suse.de, axboe@kernel.dk,
mwilck@suse.com, Damien Le Moal <damien.lemoal@wdc.com>,
Bart Van Assche <Bart.VanAssche@wdc.com>
Subject: Re: [PATCH] libxfs: detect zoned disks and prevent their raw use
Date: Sat, 16 Jun 2018 10:13:14 +1000 [thread overview]
Message-ID: <20180616001314.GS10363@dastard> (raw)
In-Reply-To: <20180615205011.7728-1-mcgrof@kernel.org>
On Fri, Jun 15, 2018 at 01:50:11PM -0700, Luis R. Rodriguez wrote:
> Using raw zoned disks by filesystems requires special handling, only
> f2fs currently supports this. All other filesystems do not support
> dealing with zoned disks directly.
>
> As such using raw zoned disks is not supported by XFS, to use them you
> need to use dm-zoned-tools, format them with dzadm, set the scheduler to
> deadline, and then setup a dmsetup with zoned type, and somehow set
> this up on every boot to live a semi-happy life for now.
>
> Even if you use dmsetup on every boot, the zoned disk is still exposed,
> and a user may still think they have to run mkfs.xfs on it instead
> of the /dev/mapper/ disk, and then mount it by mistake.
>
> In either case you may seem to believe your disk works and only eventually
> end up with alignmet issues and perhaps lose you data. For instance:
>
> [10869.959501] device-mapper: zoned reclaim: (sda): Align zone 865 wp 28349 to 30842 (wp+2493) blocks failed -5
> [10870.014488] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
> [10870.016137] sd 0:0:0:0: [sda] tag#0 Sense Key : Illegal Request [current]
> [10870.017696] sd 0:0:0:0: [sda] tag#0 Add. Sense: Unaligned write command
>
> We have to prevent these mistakes by avoiding mkfs.xfs use on zoned disks.
>
> Note that this not enough yet, if users are on old AHCI controllers,
> the disks may not be detected as zoned. More work through udev may be
> required to detect this situation old old parent PCI IDs for zoned
> disks, and then prevent their use somehow.
>
> If you are stuck on using XFS there a udev rule out there [0], this is
> far from perfect, and not fully what we want done upstream on Linux
> distributions long term but it should at least help developers for now
> enjoy their shiny big fat zoned disks with XFS.
>
> This check should help avoid having folks shoot themselves in the foot
> for now with zoned disks. If you make the mistake to use mkfs.xfs
> on a zoned disk, you will now get:
>
> # mkfs.xfs /dev/sda
> /dev/sda: zoned disk detected, refer to dm-zoned-tools for how to use with XFS
Shouldn't this code be put in libblkid() so it's available to all
filesystem tools, not just XFS?
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2018-06-16 0:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 20:50 [PATCH] libxfs: detect zoned disks and prevent their raw use Luis R. Rodriguez
2018-06-15 20:56 ` Bart Van Assche
2018-06-15 20:59 ` Darrick J. Wong
2018-06-15 21:48 ` Eric Sandeen
2018-06-15 21:52 ` Luis R. Rodriguez
2018-06-16 0:13 ` Dave Chinner [this message]
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=20180616001314.GS10363@dastard \
--to=david@fromorbit.com \
--cc=Bart.VanAssche@wdc.com \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=hare@suse.de \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mwilck@suse.com \
--cc=sandeen@sandeen.net \
--cc=snitzer@redhat.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;
as well as URLs for NNTP newsgroup(s).