From patchwork Mon Sep 18 07:21:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9955589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B31B60569 for ; Mon, 18 Sep 2017 07:22:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 491C328A52 for ; Mon, 18 Sep 2017 07:22:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BF9E28BB1; Mon, 18 Sep 2017 07:22:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA22328B27 for ; Mon, 18 Sep 2017 07:22:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752376AbdIRHV6 (ORCPT ); Mon, 18 Sep 2017 03:21:58 -0400 Received: from mout.gmx.net ([212.227.17.21]:59281 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbdIRHV4 (ORCPT ); Mon, 18 Sep 2017 03:21:56 -0400 Received: from localhost.localdomain ([45.32.39.184]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MZwYd-1e7Fzp1lq3-00Lk9p; Mon, 18 Sep 2017 09:21:55 +0200 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH v3 07/14] btrfs-progs: Doc/mkfs: Add extra condition for rootdir option Date: Mon, 18 Sep 2017 16:21:32 +0900 Message-Id: <20170918072139.6300-8-quwenruo.btrfs@gmx.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170918072139.6300-1-quwenruo.btrfs@gmx.com> References: <20170918072139.6300-1-quwenruo.btrfs@gmx.com> X-Provags-ID: V03:K0:iDqxDJyZmWOYebLfZmPYd1mq9Xr5L1Z8m8nTHyy/SyIDTfYlhuL VyocY17Kw005dKrmyo/L7iu3fb3ulwC5wefeS2TH9fNmu/A1qNTes4p/w1T3FNmbHinRRLq bDJHaNSvwsRurqsNj3sCp9g8ZQM3Ek22ynL2g8a+96ty+/FDJz1+yuhfRKYluo7ymXYdgy6 9FhDOcDb3fyqqVIha06sQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:sJ4yy/KTmQA=:YUmQy0qPspibhorFv4sfYW hhH7IVrVWTbRZqmZJhXQAw9SRnLyJ5gaEMR+1rdCsrg/Pd2E2anvd3nTUG6SzM1HInXIqA0z8 wL72Gqq+V/UWhV8r8Qi7+UvsXJVnXbO5BDdZp/muROCY1Nnea6WX9HGaI/aYrDyDTYKj+2Kw2 gox3HwimmbhSBCTyGl+445FiI98aT0LJGUpwzAyW5q44oRQi49VgrXL8XgHzM2Z6+xMGindYD LgMKffdYIA+kYR9tnbB7YTUFRhR+/JPl+RwV+wHqcTZU8ci/6EegX2FzcVycsqLvzFMdWbiD2 Dd3UkaXfcP36533hqs9e6ZAto7NWNAvn8a7C4LVLm6W7KpnzUg3cJ13ru/+EsOA/339TBrkIn WcCbE1PvvrP1YdXL/Fy+M3NovtsTBPLKQFUHPlQryC3xVgBqN9iqFdSmJDTDl8Ipsw6YTjJwT MvCIBiVIUawl9fy4GkHMQb6wd+HN9B0P7jgd8THAPMrYueR8D4AzHCZ7mm9qYirPEnJI1hF6I Jf5JaNMWVhuWxZEHa+SZx67nNuLAH1YtgWUxcbZ+kv75o+j0Rwq4WBgZgT/2k2J12v4TjifCE 9oDvl5cukTkRf5razyxjlsv8Ca6oIiAefM8zEY8Mx64j4bOO0a161zhsG3DJ/KnujM3FDYk18 UeEam98ba3BLTADzBIrYovcakTGw6wCXyP/r59nQVReaJ3ZiAS516y8oj3zL12L+Ct2wv0aYw 5E0lB4GylWMpH6MlF1qCI813HX/mq4eFoIG6T+MSDFk+UVX42kUm+pNGqFwvQI+5UqeHs1VnM G68pO5KYQB6UwNGE3xjv3Z6lCCcgg== Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add extra limitation explained for --rootdir option, including: 1) Size limitation Now I decide to follow "mkfs.ext4 -d" behavior, so user is responsible to make sure the block device/file is large enough. 2) Read permission If user can't read the content, mkfs will just fail. So user is also responsible to make sure to have enough privilege. 3) Extra warning about the behavior change Since we we don't shrink fs the create file image, add such warning in documentation. Signed-off-by: Qu Wenruo --- Documentation/mkfs.btrfs.asciidoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc index d53d9e26..645a2881 100644 --- a/Documentation/mkfs.btrfs.asciidoc +++ b/Documentation/mkfs.btrfs.asciidoc @@ -106,6 +106,19 @@ Please see the mount option 'discard' for that in `btrfs`(5). *-r|--rootdir *:: Populate the toplevel subvolume with files from 'rootdir'. This does not require root permissions and does not mount the filesystem. ++ +With this option, only one device can be specified. ++ +NOTE: User should make sure the block device/file has large enough space to +contain the source directory and has enough previllege to read source directory. +Or mkfs will just fail. ++ +WARNING: Before v4.14 btrfs-progs, *--rootdir* will shrink the filesystem, +prevent user to make use of the remaining space. +In v4.14 btrfs-progs, this behavior is changed, and will not shrink the fs. +The result should be the same as `mkfs`, `mount` and then `cp -r`. + +Also, if destination file/block device does not exist, *--rootdir* will not +create the image file, to make it follow the normal mkfs behavior. *-O|--features [,...]*:: A list of filesystem features turned on at mkfs time. Not all features are