Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1450932imm; Mon, 3 Sep 2018 00:19:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ8wSDBTYRQZ2MdVUl68w4QWeI+uN10JV+cNZUMIofcBsfusSagzJgS50KY/7CjMYlZpcob X-Received: by 2002:a63:f501:: with SMTP id w1-v6mr20324046pgh.446.1535959184508; Mon, 03 Sep 2018 00:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535959184; cv=none; d=google.com; s=arc-20160816; b=gR43No1DACZLIl82XWLeBwZyZap8nrJwG24Ey0fc/z7cXQUbSVyRvP10ZoYSym2W7r TaCEsg9QcflUd3AXb4PdbvV49WkqlZFOhDa3uxWTWkQPaYPPKZLb4evpXwIB+W2DJ5cA CkAEiJ0AlGbTlVdTN6QCIxNSeSSkX6o1xucQ0EI5g6rWFDJ++ZPnXZHtWAManhgaz1Cv G+fRxgM5teV1rswR2tdROP3cD/zbIAm1gbACylE2XWrsNf74YcPpFZyIzhR0n8LKVj7e fGUZihpzL2hUaAUd4iTWUsmYgFonNz8HHSs6h44iWSWtO87LFgBpMwmzv8qwNz6SRQlU h39A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:arc-authentication-results; bh=R9ESBv1tdYZXG8mluRRrmFb09T5QizS8DciUmb0f96w=; b=OOHY18+2RSql7p0WPQ2fNwPNret2y9gdk0mliB2rpkrSwDl9GTId2d53VsmMhYX7AO B5v9roh1p42kr7e32GruVKiKzHfP/gJh7eDqjs2UZG0Y2ua8h3osJmvCGgxV/C6FvtaD qV/CFy6U06xCGQkaCmxz0LtC+B2+Hh5GQHjYfA6BBOlaEr5E+CloKvnAZxvIULNOEEcD V/SYYJAYoV051vSx1QX3uNYsohC7dxMr3yLDak/e6vMP3U0dh852k55xzo68rB+CDemn lGaY8hO2DRBVZOJBBbpzbdygPDg1rGZEDTTKE08+sQV05b7UXXTTyH70/rqY/cwwT1Or E0Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3-v6si17017798pld.281.2018.09.03.00.19.29; Mon, 03 Sep 2018 00:19:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbeICLgT (ORCPT + 99 others); Mon, 3 Sep 2018 07:36:19 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:54834 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbeICLgT (ORCPT ); Mon, 3 Sep 2018 07:36:19 -0400 Received: from ibmpc.myhome.or.jp (server.parknet.ne.jp [210.171.168.39]) by mail.parknet.co.jp (Postfix) with ESMTPSA id D4C5515AF4B; Mon, 3 Sep 2018 16:17:28 +0900 (JST) Received: from devron.myhome.or.jp (foobar@devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w837HR4q018546 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 3 Sep 2018 16:17:28 +0900 Received: from devron.myhome.or.jp (foobar@localhost [127.0.0.1]) by devron.myhome.or.jp (8.15.2/8.15.2/Debian-11) with ESMTPS id w837HRw5001540 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 3 Sep 2018 16:17:27 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.15.2/8.15.2/Submit) id w837HRrM001539; Mon, 3 Sep 2018 16:17:27 +0900 From: OGAWA Hirofumi To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fat: Relax checks for sector size and media type References: <20180902131932.11558-1-pali.rohar@gmail.com> Date: Mon, 03 Sep 2018 16:17:26 +0900 In-Reply-To: <20180902131932.11558-1-pali.rohar@gmail.com> ("Pali =?iso-8859-1?Q?Roh=E1r=22's?= message of "Sun, 2 Sep 2018 15:19:32 +0200") Message-ID: <87bm9ft5h5.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pali Roh?r writes: > Windows fastfat.sys driver accepts also media types 0x00 and 0x01 and > sector sizes 128 and 256 bytes. Linux mkfs.fat can format disk also to > larger FAT sector sizes then 4096 bytes, therefore relax also upper limit > restriction. > - if (!is_power_of_2(bpb->fat_sector_size) > - || (bpb->fat_sector_size < 512) > - || (bpb->fat_sector_size > 4096)) { > + if (!is_power_of_2(bpb->fat_sector_size)) { Just relaxing validation doesn't work. The block layer doesn't support smaller than 512, and lager than PAGE_SIZE. (And in specification, fat doesn't support lager than 4096.) > static inline int fat_valid_media(u8 media) > { > - return 0xf8 <= media || media == 0xf0; > + return 0xf8 <= media || media == 0xf0 || media == 0x00 || media == 0x01; > } > #endif /* !_LINUX_MSDOS_FS_H */ This is ok though, this would be for ancient floppy media. Thanks. -- OGAWA Hirofumi