Patchwork [1/2] mke2fs: Add revision to the is_before_linux_ver()

login
register
mail settings
Submitter Lukas Czerner
Date Feb. 24, 2014, 5:41 p.m.
Message ID <1393263666-21246-1-git-send-email-lczerner@redhat.com>
Download mbox | patch
Permalink /patch/323706/
State Accepted
Headers show

Comments

Lukas Czerner - Feb. 24, 2014, 5:41 p.m.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 misc/mke2fs.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
Theodore Ts'o - July 6, 2014, 1:09 a.m.
On Mon, Feb 24, 2014 at 06:41:05PM +0100, Lukas Czerner wrote:
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Thanks, applied.

					- Ted
--
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

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index facbe4c..957b4b6 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -177,7 +177,8 @@  static int parse_version_number(const char *s)
 	return KERNEL_VERSION(major, minor, rev);
 }
 
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
+			       unsigned int rev)
 {
 	struct		utsname ut;
 	static int	linux_version_code = -1;
@@ -191,10 +192,11 @@  static int is_before_linux_ver(unsigned int major, unsigned int minor)
 	if (linux_version_code == 0)
 		return 0;
 
-	return linux_version_code < KERNEL_VERSION(major, minor, 0);
+	return linux_version_code < KERNEL_VERSION(major, minor, rev);
 }
 #else
-static int is_before_linux_ver(unsigned int major, unsigned int minor)
+static int is_before_linux_ver(unsigned int major, unsigned int minor,
+			       unsigned int rev)
 {
 	return 0;
 }
@@ -1513,7 +1515,7 @@  profile_error:
 	memset(&fs_param, 0, sizeof(struct ext2_super_block));
 	fs_param.s_rev_level = 1;  /* Create revision 1 filesystems now */
 
-	if (is_before_linux_ver(2, 2))
+	if (is_before_linux_ver(2, 2, 0))
 		fs_param.s_rev_level = 0;
 
 	if (argc && *argv) {
@@ -1952,7 +1954,7 @@  profile_error:
 
 		if (use_bsize == -1) {
 			use_bsize = sys_page_size;
-			if (is_before_linux_ver(2, 6) && use_bsize > 4096)
+			if (is_before_linux_ver(2, 6, 0) && use_bsize > 4096)
 				use_bsize = 4096;
 		}
 		if (lsector_size && use_bsize < lsector_size)