From: OGAWA Hirofumi Subject: Re: Crash with 512 byte blocks on 4K media Date: Tue, 03 Jun 2014 00:27:29 +0900 Message-ID: <87bnubuyam.fsf@devron.myhome.or.jp> References: <20140602154016.697bf121@alan.etchedpixels.co.uk> Mime-Version: 1.0 Content-Type: text/plain Cc: linux-fsdevel@vger.kernel.org, Conrad Meyer To: One Thousand Gnomes Return-path: Received: from mail.parknet.co.jp ([210.171.160.6]:57681 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbaFBPyJ (ORCPT ); Mon, 2 Jun 2014 11:54:09 -0400 In-Reply-To: <20140602154016.697bf121@alan.etchedpixels.co.uk> (One Thousand Gnomes's message of "Mon, 2 Jun 2014 15:40:16 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: One Thousand Gnomes writes: > A FAT mount of 512 byte block fs on 4K media now crashes. It used to just > error. This is of course doubly fun if you've got your own USB key > firmware and an automounting distribution 8-) This seems to be the bug of recent patch to fatfs. Does the following patch fix this? Thanks. Subject: [PATCH] fat: Fix missed error code by "add support for DOS 1.x formatted volumes" In "add support for DOS 1.x formatted volumes" patch, "error" is overwritten by fat_read_bpb(). This patch reset "error" to -EIO, to return proper error. Cc: Conrad Meyer Signed-off-by: OGAWA Hirofumi --- fs/fat/inode.c | 1 + 1 file changed, 1 insertion(+) diff -puN fs/fat/inode.c~fat-fix-error-handling fs/fat/inode.c --- linux-next/fs/fat/inode.c~fat-fix-error-handling 2014-06-03 00:20:03.773448083 +0900 +++ linux-next-hirofumi/fs/fat/inode.c 2014-06-03 00:20:08.717435605 +0900 @@ -1622,6 +1622,7 @@ int fat_fill_super(struct super_block *s logical_sector_size = bpb.fat_sector_size; sbi->sec_per_clus = bpb.fat_sec_per_clus; + error = -EIO; if (logical_sector_size < sb->s_blocksize) { fat_msg(sb, KERN_ERR, "logical sector size too small for device" " (logical sector size = %u)", logical_sector_size); _ -- OGAWA Hirofumi