linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
@ 2018-11-24 22:01 Carmeli Tamir
  2018-11-26  5:07 ` Sergey Senozhatsky
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Carmeli Tamir @ 2018-11-24 22:01 UTC (permalink / raw)
  To: axboe, sergey.senozhatsky, jthumshirn, bvanassche,
	martin.petersen, linux-kernel, carmeli.tamir

The FAT file system volume label file stored in the root directory should
match the volume label field in the FAT boot sector. As consequence, the
max length of these fields ought to be the same. This patch replaces the
magic '11' usef in the struct fat_boot_sector with MSDOS_NAME,
which is used in struct msdos_dir_entry.

Please check 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'.
3. User space code that creates FAT filesystem 
sometimes uses MSDOS_NAME for the label, sometimes not.
Search for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. 
I consider to make the same patch there as well.
https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c


Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>
---
 include/uapi/linux/msdos_fs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
index fde7537..1216e6c 100644
--- a/include/uapi/linux/msdos_fs.h
+++ b/include/uapi/linux/msdos_fs.h
@@ -135,7 +135,7 @@ struct fat_boot_sector {
 						   for mount state. */
 			__u8	signature;  /* extended boot signature */
 			__u8	vol_id[4];	/* volume ID */
-			__u8	vol_label[11];	/* volume label */
+			__u8	vol_label[MSDOS_NAME];	/* volume label */
 			__u8	fs_type[8];		/* file system type */
 			/* other fields are not added here */
 		} fat16;
@@ -158,7 +158,7 @@ struct fat_boot_sector {
 						   for mount state. */
 			__u8	signature;  /* extended boot signature */
 			__u8	vol_id[4];	/* volume ID */
-			__u8	vol_label[11];	/* volume label */
+			__u8	vol_label[MSDOS_NAME];	/* volume label */
 			__u8	fs_type[8];		/* file system type */
 			/* other fields are not added here */
 		} fat32;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
  2018-11-24 22:01 [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label Carmeli Tamir
@ 2018-11-26  5:07 ` Sergey Senozhatsky
  2018-11-26  7:58 ` Johannes Thumshirn
  2018-11-27  2:08 ` OGAWA Hirofumi
  2 siblings, 0 replies; 6+ messages in thread
From: Sergey Senozhatsky @ 2018-11-26  5:07 UTC (permalink / raw)
  To: Carmeli Tamir
  Cc: axboe, sergey.senozhatsky, jthumshirn, bvanassche,
	martin.petersen, linux-kernel

On (11/24/18 17:01), Carmeli Tamir wrote:
> The FAT file system volume label file stored in the root directory should
> match the volume label field in the FAT boot sector. As consequence, the
> max length of these fields ought to be the same. This patch replaces the
> magic '11' usef in the struct fat_boot_sector with MSDOS_NAME,
> which is used in struct msdos_dir_entry.
>
> Please check the following references:
> 1. Microsoft FAT specification 2005
> (http://read.pudn.com/downloads77/ebook/294884/FAT32%20Spec%20%28SDA%20Contribution%29.pdf).
[..]
> Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>

Looks good to me,
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
  2018-11-24 22:01 [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label Carmeli Tamir
  2018-11-26  5:07 ` Sergey Senozhatsky
@ 2018-11-26  7:58 ` Johannes Thumshirn
  2018-11-26 19:23   ` Tamir Carmeli
  2018-11-27  2:08 ` OGAWA Hirofumi
  2 siblings, 1 reply; 6+ messages in thread
From: Johannes Thumshirn @ 2018-11-26  7:58 UTC (permalink / raw)
  To: Carmeli Tamir, axboe, sergey.senozhatsky, bvanassche,
	martin.petersen, linux-kernel

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
-- 
Johannes Thumshirn                                        SUSE Labs
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
  2018-11-26  7:58 ` Johannes Thumshirn
@ 2018-11-26 19:23   ` Tamir Carmeli
  2018-11-27  1:40     ` Sergey Senozhatsky
  0 siblings, 1 reply; 6+ messages in thread
From: Tamir Carmeli @ 2018-11-26 19:23 UTC (permalink / raw)
  To: jthumshirn
  Cc: axboe, Sergey Senozhatsky, bvanassche, martin.petersen, linux-kernel

Thanks for the reply and sorry for my noob question:
Wasn't I supposed to send this patch also to the FAT maintainer, OGAWA
Hirofumi? His name wasn't on the get_maintainer output, and I think
that this specific file isn't listed anywhere under the maintainers
file.

On Mon, Nov 26, 2018 at 9:58 AM Johannes Thumshirn <jthumshirn@suse.de> wrote:
>
> Looks good,
> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
> --
> Johannes Thumshirn                                        SUSE Labs
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
  2018-11-26 19:23   ` Tamir Carmeli
@ 2018-11-27  1:40     ` Sergey Senozhatsky
  0 siblings, 0 replies; 6+ messages in thread
From: Sergey Senozhatsky @ 2018-11-27  1:40 UTC (permalink / raw)
  To: Tamir Carmeli
  Cc: jthumshirn, axboe, Sergey Senozhatsky, bvanassche,
	martin.petersen, linux-kernel, OGAWA Hirofumi

On (11/26/18 21:23), Tamir Carmeli wrote:
> Thanks for the reply and sorry for my noob question:
> Wasn't I supposed to send this patch also to the FAT maintainer, OGAWA
> Hirofumi?

Yes.

> His name wasn't on the get_maintainer output, and I think
> that this specific file isn't listed anywhere under the maintainers
> file.

Right. Not all headers are tracked; so usually you'd want
to ./scripts/get_maintainer.pl fs/fat (where C files are).

	-ss

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label
  2018-11-24 22:01 [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label Carmeli Tamir
  2018-11-26  5:07 ` Sergey Senozhatsky
  2018-11-26  7:58 ` Johannes Thumshirn
@ 2018-11-27  2:08 ` OGAWA Hirofumi
  2 siblings, 0 replies; 6+ messages in thread
From: OGAWA Hirofumi @ 2018-11-27  2:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Carmeli Tamir, axboe, sergey.senozhatsky, jthumshirn, bvanassche,
	martin.petersen, linux-kernel

Carmeli Tamir <carmeli.tamir@gmail.com> writes:

> The FAT file system volume label file stored in the root directory should
> match the volume label field in the FAT boot sector. As consequence, the
> max length of these fields ought to be the same. This patch replaces the
> magic '11' usef in the struct fat_boot_sector with MSDOS_NAME,
> which is used in struct msdos_dir_entry.
>
> Please check 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'.
> 3. User space code that creates FAT filesystem 
> sometimes uses MSDOS_NAME for the label, sometimes not.
> Search for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. 
> I consider to make the same patch there as well.
> https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c
>
> Signed-off-by: Carmeli Tamir <carmeli.tamir@gmail.com>

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Looks good. Thanks.

> ---
>  include/uapi/linux/msdos_fs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
> index fde7537..1216e6c 100644
> --- a/include/uapi/linux/msdos_fs.h
> +++ b/include/uapi/linux/msdos_fs.h
> @@ -135,7 +135,7 @@ struct fat_boot_sector {
>  						   for mount state. */
>  			__u8	signature;  /* extended boot signature */
>  			__u8	vol_id[4];	/* volume ID */
> -			__u8	vol_label[11];	/* volume label */
> +			__u8	vol_label[MSDOS_NAME];	/* volume label */
>  			__u8	fs_type[8];		/* file system type */
>  			/* other fields are not added here */
>  		} fat16;
> @@ -158,7 +158,7 @@ struct fat_boot_sector {
>  						   for mount state. */
>  			__u8	signature;  /* extended boot signature */
>  			__u8	vol_id[4];	/* volume ID */
> -			__u8	vol_label[11];	/* volume label */
> +			__u8	vol_label[MSDOS_NAME];	/* volume label */
>  			__u8	fs_type[8];		/* file system type */
>  			/* other fields are not added here */
>  		} fat32;

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-11-27  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 22:01 [PATCH] fat: Replaced 11 magic to MSDOS_NAME for volume label Carmeli Tamir
2018-11-26  5:07 ` Sergey Senozhatsky
2018-11-26  7:58 ` Johannes Thumshirn
2018-11-26 19:23   ` Tamir Carmeli
2018-11-27  1:40     ` Sergey Senozhatsky
2018-11-27  2:08 ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).