From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A60C169C4 for ; Mon, 11 Feb 2019 20:52:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 713F6218D8 for ; Mon, 11 Feb 2019 20:52:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=dilger-ca.20150623.gappssmtp.com header.i=@dilger-ca.20150623.gappssmtp.com header.b="pi8G+uxF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfBKUw3 (ORCPT ); Mon, 11 Feb 2019 15:52:29 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:43293 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbfBKUw3 (ORCPT ); Mon, 11 Feb 2019 15:52:29 -0500 Received: by mail-pf1-f195.google.com with SMTP id q17so118761pfh.10 for ; Mon, 11 Feb 2019 12:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilger-ca.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=yosQUIAOvxDbt5VBVwyQdBhqY2MDQARsqOUK39kflcs=; b=pi8G+uxFHMT4Z7gIJZ/I6Ip71BhwSG2mAVyl4uS5rrSy4hcnkdwhIMNsQxsL4aDSQw L3Nx6EX3OE5F7c2GPslKqdWrb3Vkjssb9Iahu6Trx0x4VSynCyk4sB44Vu5usvIrh79+ p+Vs0xWzpgqk6qERLOONPllTaUNePDAYC/x+XpA+4H83BZjeT/+UNM+lHOXyyDKQ/Uod m06Uut4iHGtAwnkaMpx2KwYF1YRuG4LKg8ayR+/NtzEKdPs92XLDk0KQ0yf2JFJBEy2I WDEj/Bl95pN64BBp4W1oj2Q+RwAiLo/6tLyGbFoW/gkWQuBFwmMRkBIFqdrzVdiMNg1v gfjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=yosQUIAOvxDbt5VBVwyQdBhqY2MDQARsqOUK39kflcs=; b=mEATlNl/aZS949+kXUiQYayYXiZj9GIEJv9En4aAs74nON1amhObLVlS5AocTPqyxk DeR3+c7GUBHWvfhrNKzBNBmJKNth2Yc4Y2Nau+g8z7xmOH3konvKlz0Dg7ay0/sTBBc6 zuILqy+y5f+FPy33pWGVScVLefOeiOfYxtEzR6+AqOHBDskoL1++N5PvzAnWsaTvWEB9 hryHfRhuibZIUnl9B4htWCMXUMe98A91rlCGcQp17Setem9iUAwsH3nnPj6KarCNHRIP OcRfmXhnNMVXBvasP0/BRQQ3dE0HmOjRy66dhhNREgnlNShI3SyfC0pCKOdiDBysfKXc bVVw== X-Gm-Message-State: AHQUAuYevwKZWPn3KQ2W62aHpViCbEIi6JVrFO+GtX7hszVHYP6ZR5Tm ra/xV0IrQu4nVKQ467IrF13lyw== X-Google-Smtp-Source: AHgI3IbN0GNEuUMgunRnt6/LolFiGx22AwKd/o9xu9n8eQ4uTLfvAHeXXlUml32t2y1VRGkicjvKvw== X-Received: by 2002:a62:e515:: with SMTP id n21mr140362pff.159.1549918348337; Mon, 11 Feb 2019 12:52:28 -0800 (PST) Received: from cabot-wlan.adilger.int (S0106a84e3fe4b223.cg.shawcable.net. [70.77.216.213]) by smtp.gmail.com with ESMTPSA id i71sm19920385pfi.170.2019.02.11.12.52.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Feb 2019 12:52:27 -0800 (PST) From: Andreas Dilger Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_A116328B-1792-4D2A-8354-B1F0934D1F4F"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Extending FIEMAP ioctl to report device id Date: Mon, 11 Feb 2019 13:52:25 -0700 In-Reply-To: <20190211152345.GC12668@bombadil.infradead.org> Cc: Carlos Maiolino , linux-fsdevel , Christoph Hellwig , darrick.wong@oracle.com To: Matthew Wilcox References: <20190211094306.fjr6gfehcstm7eqq@hades.usersys.redhat.com> <20190211152345.GC12668@bombadil.infradead.org> X-Mailer: Apple Mail (2.3273) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org --Apple-Mail=_A116328B-1792-4D2A-8354-B1F0934D1F4F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 11, 2019, at 8:23 AM, Matthew Wilcox wrote: >=20 > On Mon, Feb 11, 2019 at 10:43:06AM +0100, Carlos Maiolino wrote: >> - The general idea, is to provide a way for FIEMAP ioctls to return = the device >> id where each extent is physically located. >=20 > How does userspace get to use this information? If I call fiemap() = and > it tells me extent 1 is on device 0x12345678 and extent 2 is on device > 0x34567812, what can I do with that information? For filesystems that may store a file on different devices, filefrag = will print out which device the file is located on, so that users can see = where the file is located. Programs (e.g a mythical LILO that used FIEMAP instead of FIBMAP) could check fe_device to see whether the whole file is located on the same = block device or not, and not allow booting from such a file. > Bear in mind that glibc uses a different dev_t from the kernel. That is glibc's problem. The kernel would return fe_device using the = same dev_t that it uses for stat.st_dev and friends. Even so, the majority = of users will care about "these blocks/files are on a different device than those other blocks/files" and not the exact meaning of the bits. >> - This is particularly useful for those filesystems where the file = extents are >> located on a different block device other than that associated with = the >> superblock , for example, btrfs using multiple devices, and XFS when = using a >> real-time device. >=20 > Darrick said it was useful for _inside_ the kernel. How is it useful > for outside the kernel? In my experience, this can be very useful for users to understand how = their file is allocated if there are performance or other issues with a = particular device. Also, in some respects, it is _required_ for multi-device = filesystems, since it makes it clear that block 123 on one device is not related to = the same block number on a different device. It may well be that ext4 will get some kind of multi-device capability = in the future (e.g. with the existing ext4 SMR patch using a separate flash = journal device and file data being permanently kept in the journal instead of = the HDD, or storing all the metadata on a flash device and all data on a HDD = device). Cheers, Andreas --Apple-Mail=_A116328B-1792-4D2A-8354-B1F0934D1F4F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAlxh4IoACgkQcqXauRfM H+AYtw/+J1OUKNRo7CBKYbVroTolbdyYT+TCPWi2yR0JkPsE2uPZIL2+lMkSlXVa vd1bbuarGA2sLtbViDrOu+EJkAWPHfnlfdsaaPHgrjzgYpWDW/i9FcpS0Rq9yDaC 9LdG409hM8k741BYW17MGGh3a8+a8j8BWP0f/9AHDdG0h5Bn7qILIBTB6rzl03PO MLuacUEiM+T04UY4E6NHY7zWQDyktrUSQF7sOx02QXcPA+JVu3Rg7gQBTScknX+p O0F7RyTh0q187sLI+VgOHJzNpJj52KoRLn8hDE9RknUOVLIJ9AFK/4Nmx+U0gy4L 89czb5EZk3GLtXZog8JHt1rSd4q7YyTaYbjOYXROkDrvtYgZgdd2QtOSLxGKdYt8 qvrKOuD5aKjqRh+fljHkwLGMiJUZlygXQS5IYV83ukFR9Z1AEhyucyOHON7seS// tHkrH5HTLZoEwovdPjwdM0vlH0y+1bFt0Htm3DwRchtjqcruAx+XRyc7LvIN1ejR 7aGleJxsKiJlSerNFsq1jV1wVXi1Of2dQDkS5YTVfSpiqD9+Z/V+17ZT72eV/RA+ DQvDlQio15H1IMHc4ZAC8KtDxh/QuEbmbPlqc7O4iMdWgnv6EncatLJ0tVhy2a1u jE93y5ruZepEHb6NMhSvdpgW9VpRPno9EOwW5ga8HJPo6mJxwuo= =8C5Z -----END PGP SIGNATURE----- --Apple-Mail=_A116328B-1792-4D2A-8354-B1F0934D1F4F--