From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:50968 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbeILPVp (ORCPT ); Wed, 12 Sep 2018 11:21:45 -0400 Date: Wed, 12 Sep 2018 12:17:50 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: OGAWA Hirofumi Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fat: Relax checks for sector size and media type Message-ID: <20180912101750.6slpi3puoww72xsj@pali> References: <20180902131932.11558-1-pali.rohar@gmail.com> <87bm9ft5h5.fsf@mail.parknet.co.jp> <20180903074005.7e3guj24ksq2l44c@pali> <874lf7t3gg.fsf@mail.parknet.co.jp> <20180903080422.ta3clnhr5bobv6il@pali> <87zhwzro1o.fsf@mail.parknet.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zhwzro1o.fsf@mail.parknet.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Monday 03 September 2018 17:19:15 OGAWA Hirofumi wrote: > Pali Rohár writes: > > >> That source seems to check power_of_2(size) and 128 <= size <= > >> 4096. Rather why do you want to support larger than 4096? Or I'm missing > >> something? > > > > I looked into (Linux) mkfs.fat and it supports formatting disk also with > > sector size > 4096. Therefore I thought it may be good idea for ability > > to mount and use it (on Linux). > > > > I could check what other operating system would do with FAT sector size > > larger then 4096. > > If there is real user to use that, I'm ok though (of course, need > serious tests). However, FAT would be for exchange data with other > devices, and there is "cluster per sector", and spec recommends sector > size == device sector size. So I suspect this format is not useful. I looked into OpenBSD, FreeBSD and NetBSD source code and there is no explicit upper limit for sector size. Just that sector size must be power of two. I have not did tests yet, but you are right that some testing should be done. As FAT operates with clusters and cluster size is defined by sector size, then sectors per cluster and sector size defines cluster size. And cluster size itself implies maximal size of FAT filesystem. So increasing sector size could be useful to create larger FAT32 filesystems as current limit hit by sector size = 512 bytes. What do you think, which operating systems should be tested? -- Pali Rohár pali.rohar@gmail.com