Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1473027imm; Mon, 3 Sep 2018 01:05:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaYquN4RyJPIhHk0yv57nYDwJVJJGfnS/vCpBaEGFePnVQk7NVMB2MV/tOGVp6QSE720Qwf X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr25246505pgi.306.1535961946099; Mon, 03 Sep 2018 01:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535961946; cv=none; d=google.com; s=arc-20160816; b=o/azNMWQw7b9WXkj0bdyrXP028f3JzFuEEc/rsIGMwSmYG+pln73hRUZ7jotsljNsK X0Q8nR1sRAg7EkLaVkTTZQqsAfDV1MudIpsiRkDZ6C7cPGNN9InR1FTGRu/3Rww5Zn/o JBrBaQnHoQ5OyKMhvQDtejVdceJ5NtRN4rWFAgSNTxO/20RJKBqjxIVPaPXGB5sYXeAW tzJPrA6QHlzL1tbYMl5jPjrW+fe2hlK61JLzjF2rYE1oqfEQldCDNC/9PS6ohYFMSjVM h/+UX3nKiOwmNPAj0PVEUGxZXHBFPYms4021dXoYa1JuDnu8BaedKAsE11uqkHSDg/3G MkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=CXO4+Z9bmvMX+FtXFbcITJcPhFYJyx24Ym8/TbikV3E=; b=nQ27IwGdhc/vyF0nzpDrH7wq0kDnHqwGX7+kjit2649nMHVo/sBi3yf+Yjg6dj+QMy YDBHzGWKHimH5rYXkP8hMbc9Wo0Ht0+E0mhTx+wH63448yBy4sraJplvnHU75auJwSIA x1NcRcMZKwrdPFktzz1VZ8f5vaXSGHflZCAa4UTGqxwzO4EpJX0WW7HaD73Lxia71n5e /G4FALy1F0vnvEI5ZYc1f/Oz2CZhY47RvGlKk/BPacVyaCMokp12BczhjUIHEEwlTIlG bSqYLREhidoxGPSBFfBajbbOQOTEh2UAgtQc3XoD6bVmAyEltNyxrtgp70s6NcP3XriL 3t7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JGN+xllQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t77-v6si16253515pgb.363.2018.09.03.01.05.30; Mon, 03 Sep 2018 01:05:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JGN+xllQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726051AbeICMXZ (ORCPT + 99 others); Mon, 3 Sep 2018 08:23:25 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34051 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725898AbeICMXY (ORCPT ); Mon, 3 Sep 2018 08:23:24 -0400 Received: by mail-wm0-f68.google.com with SMTP id j25-v6so8215271wmc.1; Mon, 03 Sep 2018 01:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=CXO4+Z9bmvMX+FtXFbcITJcPhFYJyx24Ym8/TbikV3E=; b=JGN+xllQsFPdbWKqr+cxJ3vRTjn3TnJmEBBmmqcj9Bx2JJYj334oVLhmY+hsq6lixa U+QMJCWxa0p6Jppk3eH0RIiykgYC3ViNxIKkKVA15Cq1E67Ks2PfhmMlefNSk95Rl4Rs QtUqcqnZv/SkYs07Wm0BBftg4wSB9zDmGnRf9nZuDd05OCZXN98CHhPcBHtUicJMlZwj dfNqeCBaZc/kmCfQQ2oC5oHuh0mYUS3A0FnTjGjBoZMQssewbZK0C0jGTEbsQ9f5oWge +h9QIfl8rdCqvQfGFn4dkGCk4OueNW9F6tG3xV9J3l7782vMi9jlK//IsEIH/Ihq9ZMo XLNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=CXO4+Z9bmvMX+FtXFbcITJcPhFYJyx24Ym8/TbikV3E=; b=K4JGOFBCZgIMROuoeJKYmOqqEtgwLy1wMJ6+KiWfiVO5Wk/UJ4mkhAM+kUGhiAN+2/ TSiBBv34piBTpQUHCN3shuF1hoo5Elw5qLn1nMhtX8nIL6rakQLIkfgSxiSirKf/1gTq VLCC1Gx2GQXuLJNPIu8bbo/grVolAkOC2JfYFhrnJOi0DmiQVh5RhaUJyeOqu3bO3oXg JBJUa+eZJiu6UCb2++HUhzFCBlGwfvGsD9n5XXwlV57f6v3628MbM3Q9nZL57cH4YADC 7KJANYFG2Vo+jypvcRAJZyMzPhb44wHBzJ3QyHPRJzaeK50mLKxn0chOSizd5VQ1sa+B DStQ== X-Gm-Message-State: APzg51AwKW/CMhSCf+ezNAXk8F3Hk+CHrM4cLl203wYQsCh9URhULXA5 Kj1lPfdLfWtI/s407lrPIc6vC0TqnZY= X-Received: by 2002:a1c:2108:: with SMTP id h8-v6mr4141871wmh.108.1535961863597; Mon, 03 Sep 2018 01:04:23 -0700 (PDT) Received: from pali ([2a02:2b88:2:1::5cc6:2f]) by smtp.gmail.com with ESMTPSA id f6-v6sm17682440wrr.68.2018.09.03.01.04.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Sep 2018 01:04:22 -0700 (PDT) Date: Mon, 3 Sep 2018 10:04:22 +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: <20180903080422.ta3clnhr5bobv6il@pali> References: <20180902131932.11558-1-pali.rohar@gmail.com> <87bm9ft5h5.fsf@mail.parknet.co.jp> <20180903074005.7e3guj24ksq2l44c@pali> <874lf7t3gg.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: <874lf7t3gg.fsf@mail.parknet.co.jp> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 03 September 2018 17:01:03 OGAWA Hirofumi wrote: > Pali Rohár writes: > > >> 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.) > > > > Hi! I just sent this patch for discussion, with links to (now open > > source) Windows implementation. I guess that Windows driver > > implementation is more "authoritative" then Microsoft's own > > specification. It is known that Windows implementation does not match > > Microsoft specification. > > > > I know at least 3 FAT specifications (MS EFI FAT, MS/SD card FAT, > > ECMA-107) and you are right that Microsoft's one does not allow sector > > sizes larger then 4096. > > > > If there is limitation by block layer, then: > > > > 1) Why we do not check for PAGE_SIZE? > > 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. > > 2) Is check in fat driver really needed (if block layer checks it)? > > Yes, isolating block layer error and fat format error to be better error > report. Ok. -- Pali Rohár pali.rohar@gmail.com