Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5491206rwn; Mon, 12 Sep 2022 09:47:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR7BIVkIvk44dHPz5OwClwrBbelxC95GlirMpEK0YBHoJbHJSomIVkWuLjpLB1FvP/mQYFDz X-Received: by 2002:a50:ee08:0:b0:44f:dc1:fc6b with SMTP id g8-20020a50ee08000000b0044f0dc1fc6bmr22396032eds.15.1663001274529; Mon, 12 Sep 2022 09:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663001274; cv=none; d=google.com; s=arc-20160816; b=WEDQ7jRYLIiRe6gY1JoDkO2StZL+awgJNmF9ddSod+cVUSbWISfBoZia7zrUImbRAZ Ti1rPHmkgYvamk6z60HiRM1MznkdO/jHTOU7bDGDgdOQ7NbXnT/dEfcff+xoVUT0rpD/ P+QB4FNnOoevPqcfBuxE2+5LmWfhpoyhtFLCrKo6TuxUDRn9SmEX1TY7BrTwn3Ouirgx sL0fJSCrS9PMn3t9MEZeFB0y3VV014FwtZWUn4WrywsZDgaEqf6mLX1m7qYLA6wOteJs PPtBmYV8R5hKiO6tInBneeKFpY+UmnkYpDbFBAtO/fNkJZ8UAqbr2O/ZtA8VUYnCbSCj 96tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=k1qhfi942LE6et0zq9FDdggKuBLOcG1Kzr/POuv/F9w=; b=zYzdsiXDdPYekwHZm5VWZgnQn5Ww6nY9etjbGuH+1d9Q6aw2c0Tua/hoiD2wlI4Y5c 8pROdDS3zIoIAnDOGtnLIxARnYp8tZrVSoTlhfmJwaHnCEZVxfmPzbGkfDcQyloZYLbn mApDWCnd+hPNKpow7eerdG+y+fuh8htWueYQMPiRslrvPQ4oXWx4vsx7naYQKGnyDjIw 3TDALBlkLEr8gM+OXZjvmVNklz4uXwfgFGwPH4dy0wN38u1Mgb9eRiiQbAmNvk1k2Oz0 7lZqtqV888VWR+AHbFWAPAU/8b3mZvXJFH5CU/cLqpsHVm3rMvO00p1g6+Tfx7jPzzFi 5z7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=VECAkElB; dkim=pass header.i=@paragon-software.com header.s=mail header.b=ZUyYOR9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj13-20020a170906db0d00b0077b6ecac099si5980760ejb.287.2022.09.12.09.47.27; Mon, 12 Sep 2022 09:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=VECAkElB; dkim=pass header.i=@paragon-software.com header.s=mail header.b=ZUyYOR9N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbiILQj1 (ORCPT + 99 others); Mon, 12 Sep 2022 12:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiILQjX (ORCPT ); Mon, 12 Sep 2022 12:39:23 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A842222AC; Mon, 12 Sep 2022 09:39:22 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 055772265; Mon, 12 Sep 2022 16:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1663000641; bh=k1qhfi942LE6et0zq9FDdggKuBLOcG1Kzr/POuv/F9w=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=VECAkElB4j3C9MnLL7fUB58mtTdpPtNMIDC7Ail0aFvOwf2QsVZarsXMqa7SiwQSY tRk/7GoRc6L58P2FaEoKZ+wT8+BnPmP6b8qZrqifjHvYZHRZEZtm7VlhJnjy2ZLTfF hsvKdbuje0b2ozaE7ZnMChrAYDAvncsvvtJGV9zo= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id AC2DD22FE; Mon, 12 Sep 2022 16:39:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1663000760; bh=k1qhfi942LE6et0zq9FDdggKuBLOcG1Kzr/POuv/F9w=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=ZUyYOR9NMBKInXXOIIOZNPUM8MAVqRQ5n6Kummmv3Y3xq7jwFfA4qisbK758Nbo9U SOhWV0nbgkSpzCsgup64/vGqL4FUa/IcwAy8vv1c+6FtAJ1/bkHkKLtbuac3Po/IBi iXQshGkpAWgPuGflFfLkAO9Jd5ibYBY/DwcCoaLY= Received: from [172.30.8.65] (172.30.8.65) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 12 Sep 2022 19:39:20 +0300 Message-ID: Date: Mon, 12 Sep 2022 19:39:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH 1/3] fs/ntfs3: Add comments about cluster size Content-Language: en-US From: Konstantin Komarov To: CC: , References: <59960918-0adb-6d53-2d77-8172e666bf40@paragon-software.com> In-Reply-To: <59960918-0adb-6d53-2d77-8172e666bf40@paragon-software.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.8.65] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit adds additional info about CONFIG_NTFS3_64BIT_CLUSTER Signed-off-by: Konstantin Komarov --- fs/ntfs3/frecord.c | 2 +- fs/ntfs3/record.c | 4 ++++ fs/ntfs3/super.c | 24 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 381a38a06ec2..b752d83cf460 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -557,7 +557,7 @@ static int ni_repack(struct ntfs_inode *ni) } if (!mi_p) { - /* Do not try if not enogh free space. */ + /* Do not try if not enough free space. */ if (le32_to_cpu(mi->mrec->used) + 8 >= rs) continue; diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index 7d2fac5ee215..c8741cfa421f 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -537,6 +537,10 @@ bool mi_resize_attr(struct mft_inode *mi, struct ATTRIB *attr, int bytes) return true; } +/* + * Pack runs in MFT record. + * If failed record is not changed. + */ int mi_pack_runs(struct mft_inode *mi, struct ATTRIB *attr, struct runs_tree *run, CLST len) { diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 47012c9bf505..86ff55133faf 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -21,6 +21,30 @@ * https://docs.microsoft.com/en-us/windows/wsl/file-permissions * It stores uid/gid/mode/dev in xattr * + * ntfs allows up to 2^64 clusters per volume. + * It means you should use 64 bits lcn to operate with ntfs. + * Implementation of ntfs.sys uses only 32 bits lcn. + * Default ntfs3 uses 32 bits lcn too. + * ntfs3 built with CONFIG_NTFS3_64BIT_CLUSTER (ntfs3_64) uses 64 bits per lcn. + * + * + * ntfs limits, cluster size is 4K (2^12) + * ----------------------------------------------------------------------------- + * | Volume size | Clusters | ntfs.sys | ntfs3 | ntfs3_64 | mkntfs | chkdsk | + * ----------------------------------------------------------------------------- + * | < 16T, 2^44 | < 2^32 | yes | yes | yes | yes | yes | + * | > 16T, 2^44 | > 2^32 | no | no | yes | yes | yes | + * ----------------------------------------------------------|------------------ + * + * To mount large volumes as ntfs one should use large cluster size (up to 2M) + * The maximum volume size in this case is 2^32 * 2^21 = 2^53 = 8P + * + * ntfs limits, cluster size is 2M (2^31) + * ----------------------------------------------------------------------------- + * | < 8P, 2^54 | < 2^32 | yes | yes | yes | yes | yes | + * | > 8P, 2^54 | > 2^32 | no | no | yes | yes | yes | + * ----------------------------------------------------------|------------------ + * */ #include -- 2.37.0