The patch titled Subject: fat: remov FAT_FIRST_ENT macro has been added to the -mm tree. Its filename is fat-removed-fat_first_ent-macro.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fat-removed-fat_first_ent-macro.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fat-removed-fat_first_ent-macro.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Carmeli Tamir <carmeli.tamir@xxxxxxxxx> Subject: fat: remov FAT_FIRST_ENT macro The comment edited in this patch was the only reference to the FAT_FIRST_ENT macro, which is not used anymore. Moreover, the commented line of code does not compile with the current code. Since the FAT_FIRST_ENT macro checks the FAT variant in a way that the patch series changes, I removed it, and instead wrote a clear explanation of what was checked. I verified that the changed comment is correct according to Microsoft FAT spec, search for "BPB_Media" in the following references: 1. Microsoft FAT specification 2005 (http://read.pudn.com/downloads77/ebook/294884/FAT32%20Spec%20%28SDA%20Contribution%29.pdf). Search for 'volume label'. 2. Microsoft Extensible Firmware Initiative, FAT32 File System Specification (https://staff.washington.edu/dittrich/misc/fatgen103.pdf). Search for 'volume label'. Link: http://lkml.kernel.org/r/1544990640-11604-2-git-send-email-carmeli.tamir@xxxxxxxxx Signed-off-by: Carmeli Tamir <carmeli.tamir@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/fat/inode.c | 12 ++++++++---- include/uapi/linux/msdos_fs.h | 3 --- 2 files changed, 8 insertions(+), 7 deletions(-) --- a/fs/fat/inode.c~fat-removed-fat_first_ent-macro +++ a/fs/fat/inode.c @@ -1803,11 +1803,15 @@ int fat_fill_super(struct super_block *s fat_ent_access_init(sb); /* - * The low byte of FAT's first entry must have same value with - * media-field. But in real world, too many devices is - * writing wrong value. So, removed that validity check. + * The low byte of the first FAT entry must have the same value as + * the media field of the boot sector. But in real world, too many + * devices are writing wrong values. So, removed that validity check. * - * if (FAT_FIRST_ENT(sb, media) != first) + * The removed check compared the first FAT entry to a value dependent + * on the media field like this: + * == (0x0F00 | media), for FAT12 + * == (0XFF00 | media), for FAT16 + * == (0x0FFFFF | media), for FAT32 */ error = -EINVAL; --- a/include/uapi/linux/msdos_fs.h~fat-removed-fat_first_ent-macro +++ a/include/uapi/linux/msdos_fs.h @@ -58,9 +58,6 @@ #define MSDOS_DOT ". " /* ".", padded to MSDOS_NAME chars */ #define MSDOS_DOTDOT ".. " /* "..", padded to MSDOS_NAME chars */ -#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 : \ - MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x)) - /* start of data cluster's entry (number of reserved clusters) */ #define FAT_START_ENT 2 _ Patches currently in -mm which might be from carmeli.tamir@xxxxxxxxx are fat-replaced-11-magic-to-msdos_name-for-volume-label.patch fat-removed-fat_first_ent-macro.patch fat-moved-max_fat-to-fath-and-changed-it-to-inline-function.patch fat-new-inline-functions-to-determine-the-fat-variant-32-16-or-12.patch