diff mbox

[V2] mke2fs: prevent creation of filesystem with unsupported revision

Message ID 5362B105.9080702@redhat.com
State Superseded, archived
Headers show

Commit Message

Eric Sandeen May 1, 2014, 8:39 p.m. UTC
From: Frank Sorenson <fsorenso@redhat.com>

Don't create a filesystem with an unsupported revision number

Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: Frank did this independently, and it's better.  I forgot about
using com_err here.

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Andreas Dilger May 1, 2014, 10:20 p.m. UTC | #1
On May 1, 2014, at 2:39 PM, Eric Sandeen <sandeen@redhat.com> wrote:

> From: Frank Sorenson <fsorenso@redhat.com>
> 
> Don't create a filesystem with an unsupported revision number

I like the commit comment on the original patch better...

Cheers, Andreas

> Signed-off-by: Frank Sorenson <fsorenso@redhat.com>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: Frank did this independently, and it's better.  I forgot about
> using com_err here.
> 
> --- a/misc/mke2fs.c	
> +++ a/misc/mke2fs.c	
> @@ -1684,6 +1684,11 @@ profile_error:
> 					_("bad revision level - %s"), optarg);
> 				exit(1);
> 			}
> +			if (r_opt > EXT2_MAX_SUPP_REV) {
> +				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
> +					_("while trying to create revision %d"), r_opt);
> +				exit(1);
> +			}
> 			fs_param.s_rev_level = r_opt;
> 			break;
> 		case 's':	/* deprecated */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Cheers, Andreas
diff mbox

Patch

--- a/misc/mke2fs.c	
+++ a/misc/mke2fs.c	
@@ -1684,6 +1684,11 @@  profile_error:
 					_("bad revision level - %s"), optarg);
 				exit(1);
 			}
+			if (r_opt > EXT2_MAX_SUPP_REV) {
+				com_err(program_name, EXT2_ET_REV_TOO_HIGH,
+					_("while trying to create revision %d"), r_opt);
+				exit(1);
+			}
 			fs_param.s_rev_level = r_opt;
 			break;
 		case 's':	/* deprecated */